瀏覽代碼

User expansion for celery commands

Mher Movsisyan 13 年之前
父節點
當前提交
4de06d76e3
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      celery/bin/base.py

+ 6 - 0
celery/bin/base.py

@@ -106,6 +106,12 @@ class Command(object):
 
         """
         options, args = self.parse_options(prog_name, argv)
+        for o in vars(options):
+            v = getattr(options, o)
+            if isinstance(v, basestring):
+                setattr(options, o, os.path.expanduser(v))
+        argv = map(lambda a: isinstance(a, basestring)
+                   and os.path.expanduser(a) or a, argv)
         if not self.supports_args and args:
             sys.stderr.write(
                 "\nUnrecognized command line arguments: %s\n" % (