Permalink
Browse files

Adding copy-dep skeleton and parser

  • Loading branch information...
1 parent ed1f31f commit a423fb532f74621800fcc54dc8242e4fa53ffa50 Yaroslav Shirokov committed Apr 4, 2009
Showing with 25 additions and 0 deletions.
  1. +25 −0 src/tasks/copy-dep.py
View
@@ -0,0 +1,25 @@
+import config
+import util
+
+OPTIONS = (("what", ("-a", "--all"), dict(help = "Copy all dependencies",
+ const = ["all"],
+ default = ['all'],
+ action = "store_const")),
+ ("what", ("-m", "--media"), dict(help = "Copy all media",
+ const = "media",
+ action = "append_const")),
+ ("what", ("-l", "--linked"), dict(help = "Copy all linked files",
+ const = "linked",
+ action = "append_const")),)
+
+
+def run(args):
+ (options, args) = util.get_args(args, OPTIONS, prog = 'copy-dep', options_func = lambda options:\
+ (len(options.what) > 1 and (options.what[0] == 'all') and (options.what.remove('all') or options))\
+ or options)
+ print options, args
+
+def help(args):
+ print "Copy dependencies (media, linked files, etc.) to output"
+ print util.get_help(OPTIONS, prog = 'copy-dep')
+

0 comments on commit a423fb5

Please sign in to comment.