BuildRequires: python-setuptools
+Requires: python >= 2.6
+Requires: python-setuptools
+
%description
This tool is to assist release engineers to operate with submissions
in easy and flexible manner
%files
%defattr(-,root,root,-)
%{_prefix}/share/doc/packages/%{name}
-%{python_sitelib}/%{name}*egg-info
+%{python_sitelib}/%{name}-%{version}-*.egg-info
+%{python_sitelib}/%{name}-%{version}-*-nspkg.pth
+%{python_sitelib}/%{name}
+%{_bindir}/%{name}
%changelog
--- /dev/null
+"""
+REPA: Release Engineering Process Assistant.
+
+Copyright (C) Intel Corporation 2013
+Licence: GPL version 2
+Author: Ed Bartosh <eduard.bartosh@intel.com>
+
+Init.
+Namespace declaration.
+"""
+
+import pkg_resources
+pkg_resources.declare_namespace(__name__)
--- /dev/null
+#!/usr/bin/env python
+
+"""
+REPA: Release Engineering Process Assistant.
+
+Copyright (C) Intel Corporation 2013
+Licence: GPL version 2
+Author: Ed Bartosh <eduard.bartosh@intel.com>
+
+Group module.
+Group submissions.
+"""
+
+import sys
+
+from repa.main import sub_main
+
+class Group(object):
+ """Subcommand: Manage group submissions."""
+
+ name = 'group'
+ description = 'Group submissions'
+ help = description
+
+ @staticmethod
+ def add_arguments(parser):
+ """Adds arguments to the parser. Called from [sub_]main."""
+ parser.add_argument('--comment', help='comment')
+
+ def run(self, argv):
+ """Command line entry point. Called from [sub_]main."""
+ print '%s: Not implemented yet' % self.help
+ print 'comment=%s' % argv.comment
+
+
+if __name__ == '__main__':
+ sys.exit(sub_main(sys.argv[1:], Group()))
--- /dev/null
+#!/usr/bin/env python
+
+"""
+REPA: Release Engineering Process Assistant.
+
+Copyright (C) Intel Corporation 2013
+Licence: GPL version 2
+Author: Ed Bartosh <eduard.bartosh@intel.com>
+
+List module.
+Get list of submissions.
+"""
+
+import sys
+
+from repa.main import sub_main
+
+class List(object):
+ """Subcommand: List submissions."""
+
+ name = 'list'
+ description = 'List submissions'
+ help = description
+
+ @staticmethod
+ def add_arguments(parser):
+ """Adds arguments to the parser. Called from [sub_]main."""
+ parser.add_argument('-regexp', default='.*', help='search regexp')
+
+ def run(self, argv):
+ """Command line entry point. Called from [sub_]main"""
+ print '%s: Not implemented yet' % self.help
+ print 'regexp=%s' % argv.regexp
+
+
+if __name__ == '__main__':
+ sys.exit(sub_main(sys.argv[1:], List()))
--- /dev/null
+#!/usr/bin/env python
+
+"""
+REPA: Release Engineering Process Assistant.
+
+Copyright (C) Intel Corporation 2013
+Licence: GPL version 2
+Author: Ed Bartosh <eduard.bartosh@intel.com>
+
+Main module.
+Command line parsing, script entry point.
+"""
+
+import sys
+import pkg_resources
+
+from argparse import ArgumentParser
+
+def parse_args(argv):
+ """Command line parsing."""
+ parser = ArgumentParser(description='Release Engineering Process Assistant')
+
+ # Define subcommands using setup.py entry points
+ subparsers = parser.add_subparsers(help='sub-command help')
+ for entry in pkg_resources.iter_entry_points(group='repa_commands'):
+ cmd = entry.load()()
+ parser_cmd = subparsers.add_parser(cmd.name,
+ description=cmd.description,
+ help=cmd.help)
+ if hasattr(cmd, 'add_arguments'):
+ cmd.add_arguments(parser_cmd)
+ parser_cmd.set_defaults(func=cmd.run)
+
+ return parser.parse_args(argv)
+
+def sub_main(argv, cmd):
+ """Subcommand entry point."""
+ parser = ArgumentParser(description=cmd.description)
+ cmd.add_arguments(parser)
+ return cmd.run(parser.parse_args(argv))
+
+def main(argv=sys.argv[1:]):
+ """Command line entry point."""
+ args = parse_args(argv)
+ return args.func(args)
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
version = '0.0.1',
author = 'Ed Bartosh',
author_email = 'eduard.bartosh@intel.com',
- data_files = [('/usr/share/doc/packages/repa/', ['README']),]
+ packages = ['repa'],
+ namespace_packages = ['repa'],
+ data_files = [('share/doc/packages/repa/', ['README']),],
+ entry_points = {
+ 'console_scripts': ['repa = repa.main:main'],
+ 'repa_commands': ['list = repa.list:List',
+ 'group = repa.group:Group']
+ }
)