1212import six
1313from six .moves import input , map
1414
15+
1516def start_interpreter (** variables ):
1617 # add the current working directory to the sys paths
1718 sys .path .append (os .getcwd ())
1819 console = type ('shopify ' + shopify .version .VERSION , (code .InteractiveConsole , object ), {})
1920 import readline
2021 console (variables ).interact ()
2122
23+
2224class ConfigFileError (Exception ):
2325 pass
2426
27+
2528def usage (usage_string ):
2629 """Decorator to add a usage string to a function"""
2730 def decorate (func ):
2831 func .usage = usage_string
2932 return func
3033 return decorate
3134
35+
3236class TasksMeta (type ):
3337 _prog = os .path .basename (sys .argv [0 ])
3438
@@ -37,6 +41,7 @@ def __new__(mcs, name, bases, new_attrs):
3741
3842 tasks = list (new_attrs .keys ())
3943 tasks .append ("help" )
44+
4045 def filter_func (item ):
4146 return not item .startswith ("_" ) and hasattr (getattr (cls , item ), "__call__" )
4247 tasks = filter (filter_func , tasks )
@@ -222,7 +227,6 @@ def _default_connection_target(cls):
222227 target = os .readlink (cls ._default_symlink )
223228 return os .path .join (cls ._shop_config_dir , target )
224229
225-
226230 @classmethod
227231 def _default_connection (cls ):
228232 target = cls ._default_connection_target ()
@@ -253,6 +257,7 @@ def _is_default(cls, connection):
253257 def _no_config_file_error (cls , filename ):
254258 raise ConfigFileError ("There is no config file at " + filename )
255259
260+
256261try :
257262 Tasks .run_task (* sys .argv [1 :])
258263except ConfigFileError as e :
0 commit comments