1- # -*- coding: utf-8 -*-
2-
31########################################################################################################################
42### Do not forget to adjust the following variables to your own plugin.
53
@@ -463,9 +461,7 @@ def run(self):
463461 shutil .rmtree (target_path )
464462
465463 print (
466- "Copying translations for locale {locale} from {source_path} to {target_path}..." .format (
467- ** locals ()
468- )
464+ f"Copying translations for locale { locale } from { source_path } to { target_path } ..."
469465 )
470466 shutil .copytree (source_path , target_path )
471467
@@ -533,7 +529,7 @@ def run(self):
533529 date = now .strftime ("%Y%m%d%H%M%S" ),
534530 ),
535531 )
536- print ("Packing translation to {zip_path}" . format ( ** locals ()) )
532+ print (f "Packing translation to { zip_path } " )
537533
538534 def add_recursively (zip , path , prefix ):
539535 if not os .path .isdir (path ):
@@ -545,12 +541,12 @@ def add_recursively(zip, path, prefix):
545541 if os .path .isdir (entry_path ):
546542 add_recursively (zip , entry_path , new_prefix )
547543 elif os .path .isfile (entry_path ):
548- print ("Adding {entry_path} as {new_prefix}" . format ( ** locals ()) )
544+ print (f "Adding { entry_path } as { new_prefix } " )
549545 zip .write (entry_path , new_prefix )
550546
551- meta_str = "last_update: {date} \n " . format ( date = now .isoformat ())
547+ meta_str = f "last_update: { now .isoformat ()} \n "
552548 if self .author :
553- meta_str += "author: {author}\n " . format ( author = self . author )
549+ meta_str += f "author: { self . author } \n "
554550
555551 zip_locale_root = self .__class__ .pack_path_prefix + locale
556552
@@ -559,7 +555,7 @@ def add_recursively(zip, path, prefix):
559555 with zipfile .ZipFile (zip_path , "w" ) as zip :
560556 add_recursively (zip , locale_dir , zip_locale_root )
561557
562- print ("Adding meta.yaml as {zip_locale_root}/meta.yaml" . format ( ** locals ()) )
558+ print (f "Adding meta.yaml as { zip_locale_root } /meta.yaml" )
563559 zip .writestr (zip_locale_root + "/meta.yaml" , meta_str )
564560
565561
@@ -630,7 +626,7 @@ def create_plugin_setup_parameters(
630626 import pkg_resources
631627
632628 if package is None :
633- package = "octoprint_{identifier}" . format ( ** locals ())
629+ package = f "octoprint_{ identifier } "
634630
635631 if additional_data is None :
636632 additional_data = list ()
@@ -686,8 +682,8 @@ def create_plugin_setup_parameters(
686682 pot_file = pot_file ,
687683 output_dir = translation_dir ,
688684 bundled_dir = bundled_dir ,
689- pack_name_prefix = "{name}-i18n-" . format ( ** locals ()) ,
690- pack_path_prefix = "_plugins/{identifier}/" . format ( ** locals ()) ,
685+ pack_name_prefix = f "{ name } -i18n-" ,
686+ pack_path_prefix = f "_plugins/{ identifier } /" ,
691687 )
692688 )
693689
@@ -697,13 +693,13 @@ def create_plugin_setup_parameters(
697693 [package ]
698694 + list (
699695 filter (
700- lambda x : x .startswith ("{package}." . format ( package = package ) ),
696+ lambda x : x .startswith (f "{ package } ." ),
701697 find_packages (where = source_folder , exclude = ignored_packages ),
702698 )
703699 )
704700 + additional_packages
705701 )
706- print ("Found packages: {packages!r}" . format ( ** locals ()) )
702+ print (f "Found packages: { packages !r} " )
707703
708704 return dict (
709705 name = name ,
@@ -733,9 +729,7 @@ def create_plugin_setup_parameters(
733729 dependency_links = dependency_links ,
734730 # Hook the plugin into the "octoprint.plugin" entry point, mapping the plugin_identifier to the plugin_package.
735731 # That way OctoPrint will be able to find the plugin and load it.
736- entry_points = {
737- "octoprint.plugin" : ["{identifier} = {package}" .format (** locals ())]
738- },
732+ entry_points = {"octoprint.plugin" : [f"{ identifier } = { package } " ]},
739733 )
740734
741735
0 commit comments