From ea18782bea4187270dfe3cddaed5fa26d83e2270 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Sun, 25 May 2008 19:52:31 +0000 Subject: Separate helpers from the commands. --- (limited to 'src') diff --git a/src/sugar/activity/bundlebuilder.py b/src/sugar/activity/bundlebuilder.py index cea6e20..cd1e77f 100644 --- a/src/sugar/activity/bundlebuilder.py +++ b/src/sugar/activity/bundlebuilder.py @@ -92,31 +92,6 @@ class _AllFileList(list): f != '.gitignore': self.append(os.path.join(root, f)) -def cmd_help(config, options, args): - print 'Usage: \n\ -setup.py build - build generated files \n\ -setup.py dev - setup for development \n\ -setup.py dist - create a bundle package \n\ -setup.py install [dirname] - install the bundle \n\ -setup.py uninstall [dirname] - uninstall the bundle \n\ -setup.py genpot - generate the gettext pot file \n\ -setup.py release - do a new release of the bundle \n\ -setup.py help - print this message \n\ -' - -def cmd_dev(config, options, args): - bundle_path = env.get_user_activities_path() - if not os.path.isdir(bundle_path): - os.mkdir(bundle_path) - bundle_path = os.path.join(bundle_path, config.bundle_top_dir) - try: - os.symlink(config.source_dir, bundle_path) - except OSError: - if os.path.islink(bundle_path): - print 'ERROR - The bundle has been already setup for development.' - else: - print 'ERROR - A bundle with the same name is already installed.' - def _get_file_list(manifest): if os.path.isfile(manifest): return _ManifestFileList(manifest) @@ -148,6 +123,31 @@ def _get_l10n_list(config): return l10n_list +def cmd_help(config, options, args): + print 'Usage: \n\ +setup.py build - build generated files \n\ +setup.py dev - setup for development \n\ +setup.py dist - create a bundle package \n\ +setup.py install [dirname] - install the bundle \n\ +setup.py uninstall [dirname] - uninstall the bundle \n\ +setup.py genpot - generate the gettext pot file \n\ +setup.py release - do a new release of the bundle \n\ +setup.py help - print this message \n\ +' + +def cmd_dev(config, options, args): + bundle_path = env.get_user_activities_path() + if not os.path.isdir(bundle_path): + os.mkdir(bundle_path) + bundle_path = os.path.join(bundle_path, config.bundle_top_dir) + try: + os.symlink(config.source_dir, bundle_path) + except OSError: + if os.path.islink(bundle_path): + print 'ERROR - The bundle has been already setup for development.' + else: + print 'ERROR - A bundle with the same name is already installed.' + def cmd_dist(config, options, args): cmd_build(config, options, args) -- cgit v0.9.1