def licensing(license=None):
    """Add license or update it to the project files

    Default is GPL-3"""


    fauthors_name = "AUTHORS"
    flicense_name = "COPYING"

    if not configurationhandler.project_config:
        configurationhandler.loadConfig()
    project_name = configurationhandler.project_config['project']
    python_name = templatetools.python_name(project_name)

    # check if we have a license tag in setup.py otherwise, default to GPL-3
    if not license:
        try:
            license = quicklyutils.get_setup_value('license')
        except quicklyutils.cant_deal_with_setup_value:
            pass
    if not license:
        license = guess_license(flicense_name)
        if license == 'other':
            msg = _("COPYING contains an unknown license.  Please run 'quickly license other' to confirm that you want to use a custom license.")
            raise LicenceError(msg)
    if not license:
        license = 'GPL-3'

    supported_licenses_list = get_supported_licenses()
    supported_licenses_list.sort()
    if license not in supported_licenses_list and license != 'other':
        cmd = commands.get_command('license', 'ubuntu-application')
        templatetools.usage_error(_("Unknown licence %s.") % license, cmd=cmd)

    # get Copyright holders in AUTHORS file
    license_content = ""
    try:
        for line in file(fauthors_name, 'r'):
            if "<Your Name> <Your E-mail>" in line:
                # if we have an author in setup.py, grab it
                try:
                    author = quicklyutils.get_setup_value('author')
                    author_email = quicklyutils.get_setup_value('author_email')
                    line = "Copyright (C) %s %s <%s>\n" % (datetime.datetime.now().year, author, author_email)
                    # update AUTHORS file
                    fout = file('%s.new' % fauthors_name, 'w')
                    fout.write(line)
                    fout.flush()
                    fout.close()
                    os.rename(fout.name, fauthors_name)
                except quicklyutils.cant_deal_with_setup_value:
                    msg = _('Copyright is not attributed. ' \
                            'Edit the AUTHORS file to include your name for the copyright replacing ' \
                            '<Your Name> <Your E-mail>. Update it in setup.py or use quickly share/quickly release ' \
                            'to fill it automatically')
                    raise LicenceError(msg)
            license_content += "# %s" % line
    except (OSError, IOError), e:
        msg = _("%s file was not found") % fauthors_name
        raise LicenceError(msg)
Beispiel #2
0

def shell_completion(argv):
    """Propose available license as the third parameter"""

    # if then license argument given, returns available licenses
    if len(argv) == 1:
        rv = get_supported_licenses()
        rv.sort()
        print ' '.join(rv)


if __name__ == "__main__":

    templatetools.handle_additional_parameters(sys.argv,
                                               help,
                                               shell_completion,
                                               usage=usage)
    license = None
    if len(sys.argv) > 2:
        cmd = commands.get_command('license', 'ubuntu-application')
        templatetools.usage_error(
            _("This command only take one optional argument."), cmd=cmd)
    if len(sys.argv) == 2:
        license = sys.argv[1]
    try:
        licensing(license)
    except LicenceError, error_message:
        print(error_message)
        sys.exit(1)
Beispiel #3
0
templatetools.handle_additional_parameters(sys.argv,
                                           help,
                                           shell_completion,
                                           usage=usage)

for_extras = False
i = 0

while i < len(sys.argv):
    arg = sys.argv[i]
    if arg.startswith('-'):
        if arg == '--extras':
            for_extras = True
        else:
            cmd = commands.get_command('package', 'ubuntu-application')
            templatetools.usage_error(_("Unknown option: %s." % arg), cmd=cmd)
    i += 1

# retrieve useful information
if not configurationhandler.project_config:
    configurationhandler.loadConfig()
project_name = configurationhandler.project_config['project']

try:
    release_version = quicklyutils.get_setup_value('version')
except quicklyutils.cant_deal_with_setup_value:
    print _("Release version not found in setup.py.")

# creation/update debian packaging
if packaging.updatepackaging(no_changelog=True, installopt=for_extras) != 0:
Beispiel #4
0
launchpad = None
project = None
ppa_name = None
i = 0
args = []
argv = sys.argv

while i < len(argv):
    arg = argv[i]
    if arg.startswith('-'):
        if arg == '--ppa':
            if i + 1 < len(argv):
                ppa_name = argv[i + 1]
                i += 1
            else:
                cmd = commands.get_command('submitubuntu', 'ubuntu-application')
                templatetools.usage_error(_("No PPA provided."), cmd=cmd)
        else:
            cmd = commands.get_command('submitubuntu', 'ubuntu-application')
            templatetools.usage_error(_("Unknown option: %s."  % arg), cmd=cmd)
    else:
        args.append(arg)
    i += 1

    commit_msg = None
if len(args) == 1:
    proposed_version = None
elif len(args) == 2:
    proposed_version = args[1]
elif len(args) > 2:
    proposed_version = args[1]
launchpad = None
project = None
ppa_name = None
i = 0
args = []
argv = sys.argv

while i < len(argv):
    arg = argv[i]
    if arg.startswith('-'):
        if arg == '--ppa':
            if i + 1 < len(argv):
                ppa_name = argv[i + 1]
                i += 1
            else:
                cmd = commands.get_command('submitubuntu', 'git-python-gtk')
                templatetools.usage_error(_("No PPA provided."), cmd=cmd)
        else:
            cmd = commands.get_command('submitubuntu', 'git-python-gtk')
            templatetools.usage_error(_("Unknown option: %s." % arg), cmd=cmd)
    else:
        args.append(arg)
    i += 1

    commit_msg = None
if len(args) == 1:
    proposed_version = None
elif len(args) == 2:
    proposed_version = args[1]
elif len(args) > 2:
    proposed_version = args[1]
Beispiel #6
0
    print _("""Tells Quickly that you have manually upgraded your project to
the latest framework.""")

templatetools.handle_additional_parameters(sys.argv, help, usage=usage)

i = 1
internal_run = False
project_version = None
template_version = None
while i < len(sys.argv):
    arg = sys.argv[i]
    if arg.startswith('-'):
        if arg == '--internal':
            internal_run = True
        else:
            cmd = commands.get_command('upgrade', 'git-python-gtk')
            templatetools.usage_error(_("Unknown option: %s."  % arg), cmd=cmd)
    else:
        if project_version is None:
            project_version = arg
        elif template_version is None:
            template_version = arg
    i += 1

(project_version_inspected, template_version_inspected) = templatetools.get_project_and_template_versions("git-python-gtk")
if project_version is None:
    project_version = project_version_inspected
if template_version is None:
    template_version = template_version_inspected

if not configurationhandler.project_config:
Beispiel #7
0
launchpad = None
project = None
ppa_name = None
i = 0
args = []
argv = sys.argv

while i < len(argv):
    arg = argv[i]
    if arg.startswith('-'):
        if arg == '--ppa':
            if i + 1 < len(argv):
                ppa_name = argv[i + 1]
                i += 1
            else:
                cmd = commands.get_command('submitubuntu',
                                           'ubuntu-application')
                templatetools.usage_error(_("No PPA provided."), cmd=cmd)
        else:
            cmd = commands.get_command('submitubuntu', 'ubuntu-application')
            templatetools.usage_error(_("Unknown option: %s." % arg), cmd=cmd)
    else:
        args.append(arg)
    i += 1

    commit_msg = None
if len(args) == 1:
    proposed_version = None
elif len(args) == 2:
    proposed_version = args[1]
elif len(args) > 2:
    proposed_version = args[1]
Beispiel #8
0
    if rv:
        rv.sort()
        print ' '.join(rv)

templatetools.handle_additional_parameters(sys.argv, help, shell_completion, usage=usage)


while i < len(argv):
    arg = argv[i]
    if arg.startswith('-'):
        if arg == '--ppa':
            if i + 1 < len(argv):
                ppa_name = argv[i + 1]
                i += 1
            else:
                cmd = commands.get_command('share', 'git-python-gtk')
                templatetools.usage_error(_("No PPA provided."), cmd=cmd)
        else:
            cmd = commands.get_command('share', 'git-python-gtk')
            templatetools.usage_error(_("Unknown option: %s."  % arg), cmd=cmd)
    else:
        args.append(arg)
    i += 1

# warning: project_name can be different from project.name (one local, one on launchpad)
if not configurationhandler.project_config:
    configurationhandler.loadConfig()
project_name = configurationhandler.project_config['project']

# connect to LP
try:
Beispiel #9
0

templatetools.handle_additional_parameters(sys.argv,
                                           help,
                                           shell_completion,
                                           usage=usage)

while i < len(argv):
    arg = argv[i]
    if arg.startswith('-'):
        if arg == '--ppa':
            if i + 1 < len(argv):
                ppa_name = argv[i + 1]
                i += 1
            else:
                cmd = commands.get_command('share', 'ubuntu-application')
                templatetools.usage_error(_("No PPA provided."), cmd=cmd)
        elif arg == '--extras':
            for_extras = True
        else:
            cmd = commands.get_command('share', 'ubuntu-application')
            templatetools.usage_error(_("Unknown option: %s." % arg), cmd=cmd)
    else:
        args.append(arg)
    i += 1

# warning: project_name can be different from project.name (one local, one on launchpad)
if not configurationhandler.project_config:
    configurationhandler.loadConfig()
project_name = configurationhandler.project_config['project']
Beispiel #10
0
the latest framework.""")


templatetools.handle_additional_parameters(sys.argv, help, usage=usage)

i = 1
internal_run = False
project_version = None
template_version = None
while i < len(sys.argv):
    arg = sys.argv[i]
    if arg.startswith('-'):
        if arg == '--internal':
            internal_run = True
        else:
            cmd = commands.get_command('upgrade', 'ubuntu-application')
            templatetools.usage_error(_("Unknown option: %s." % arg), cmd=cmd)
    else:
        if project_version is None:
            project_version = arg
        elif template_version is None:
            template_version = arg
    i += 1

(project_version_inspected, template_version_inspected
 ) = templatetools.get_project_and_template_versions("ubuntu-application")
if project_version is None:
    project_version = project_version_inspected
if template_version is None:
    template_version = template_version_inspected
Beispiel #11
0
    ''' Complete args '''
    # option completion
    rv = []
    if len(argv) == 1:
        rv = options.keys()
    if rv:
        rv.sort()
        print ' '.join(rv)


templatetools.handle_additional_parameters(sys.argv,
                                           help,
                                           shell_completion,
                                           usage=usage)

if len(sys.argv) < 2:
    cmd = commands.get_command('add', 'ubuntu-application')
    templatetools.usage_error(_("Cannot add, no plugin name provided."),
                              cmd=cmd,
                              template='ubuntu-application')

if argv[1] in ADDABLE.keys():
    ADDABLE[argv[1]].add(options)
else:
    cmd = commands.get_command('add', 'ubuntu-application')
    templatetools.usage_error(_(
        'Cannot add, did not recognize plugin name: %s' % argv[1]),
                              cmd=cmd,
                              template='ubuntu-application')
    sys.exit(4)
Beispiel #12
0
    if rv:
        rv.sort()
        print ' '.join(rv)

templatetools.handle_additional_parameters(sys.argv, help, shell_completion, usage=usage)


while i < len(argv):
    arg = argv[i]
    if arg.startswith('-'):
        if arg == '--ppa':
            if i + 1 < len(argv):
                ppa_name = argv[i + 1]
                i += 1
            else:
                cmd = commands.get_command('share', 'ubuntu-application')
                templatetools.usage_error(_("No PPA provided."), cmd=cmd)
        elif arg == '--extras':
            for_extras = True
        else:
            cmd = commands.get_command('share', 'ubuntu-application')
            templatetools.usage_error(_("Unknown option: %s."  % arg), cmd=cmd)
    else:
        args.append(arg)
    i += 1

# warning: project_name can be different from project.name (one local, one on launchpad)
if not configurationhandler.project_config:
    configurationhandler.loadConfig()
project_name = configurationhandler.project_config['project']
Beispiel #13
0
launchpad = None
project = None
ppa_name = None
i = 0
args = []
argv = sys.argv

while i < len(argv):
    arg = argv[i]
    if arg.startswith('-'):
        if arg == '--ppa':
            if i + 1 < len(argv):
                ppa_name = argv[i + 1]
                i += 1
            else:
                cmd = commands.get_command('release', 'ubuntu-application')
                templatetools.usage_error(_("No PPA provided."), cmd=cmd)
        else:
            cmd = commands.get_command('release', 'ubuntu-application')
            templatetools.usage_error(_("Unknown option: %s." % arg), cmd=cmd)
    else:
        args.append(arg)
    i += 1

    commit_msg = None
if len(args) == 1:
    proposed_version = None
elif len(args) == 2:
    proposed_version = args[1]
elif len(args) > 2:
    proposed_version = args[1]
Beispiel #14
0
launchpad = None
project = None
ppa_name = None
i = 0
args = []
argv = sys.argv

while i < len(argv):
    arg = argv[i]
    if arg.startswith('-'):
        if arg == '--ppa':
            if i + 1 < len(argv):
                ppa_name = argv[i + 1]
                i += 1
            else:
                cmd = commands.get_command('release', 'git-python-gtk')
                templatetools.usage_error(_("No PPA provided."), cmd=cmd)
        else:
            cmd = commands.get_command('release', 'git-python-gtk')
            templatetools.usage_error(_("Unknown option: %s." % arg), cmd=cmd)
    else:
        args.append(arg)
    i += 1

    commit_msg = None
if len(args) == 1:
    proposed_version = None
elif len(args) == 2:
    proposed_version = args[1]
elif len(args) > 2:
    proposed_version = args[1]
Beispiel #15
0
def licensing(license=None):
    """Add license or update it to the project files

    Default is GPL-3"""

    fauthors_name = "AUTHORS"
    flicense_name = "COPYING"

    if not configurationhandler.project_config:
        configurationhandler.loadConfig()
    project_name = configurationhandler.project_config['project']
    python_name = templatetools.python_name(project_name)

    # check if we have a license tag in setup.py otherwise, default to GPL-3
    if not license:
        try:
            license = quicklyutils.get_setup_value('license')
        except quicklyutils.cant_deal_with_setup_value:
            pass
    if not license:
        license = guess_license(flicense_name)
        if license == 'other':
            msg = _(
                "COPYING contains an unknown license.  Please run 'quickly license other' to confirm that you want to use a custom license."
            )
            raise LicenceError(msg)
    if not license:
        license = 'GPL-3'

    supported_licenses_list = get_supported_licenses()
    supported_licenses_list.sort()
    if license not in supported_licenses_list and license != 'other':
        cmd = commands.get_command('license', 'ubuntu-application')
        templatetools.usage_error(_("Unknown licence %s.") % license, cmd=cmd)

    # get Copyright holders in AUTHORS file
    license_content = ""
    try:
        for line in file(fauthors_name, 'r'):
            if "<Your Name> <Your E-mail>" in line:
                # if we have an author in setup.py, grab it
                try:
                    author = quicklyutils.get_setup_value('author')
                    author_email = quicklyutils.get_setup_value('author_email')
                    line = "Copyright (C) %s %s <%s>\n" % (
                        datetime.datetime.now().year, author, author_email)
                    # update AUTHORS file
                    fout = file('%s.new' % fauthors_name, 'w')
                    fout.write(line)
                    fout.flush()
                    fout.close()
                    os.rename(fout.name, fauthors_name)
                except quicklyutils.cant_deal_with_setup_value:
                    msg = _('Copyright is not attributed. ' \
                            'Edit the AUTHORS file to include your name for the copyright replacing ' \
                            '<Your Name> <Your E-mail>. Update it in setup.py or use quickly share/quickly release ' \
                            'to fill it automatically')
                    raise LicenceError(msg)
            license_content += "# %s" % line
    except (OSError, IOError), e:
        msg = _("%s file was not found") % fauthors_name
        raise LicenceError(msg)
Beispiel #16
0
    ''' Complete args '''
    # option completion
    rv = []
    if len(argv) == 1:
        rv = options.keys()
    if rv:
        rv.sort()
        print ' '.join(rv)


templatetools.handle_additional_parameters(sys.argv,
                                           help,
                                           shell_completion,
                                           usage=usage)

if len(sys.argv) < 2:
    cmd = commands.get_command('add', 'git-python-gtk')
    templatetools.usage_error(_("Cannot add, no plugin name provided."),
                              cmd=cmd,
                              template='git-python-gtk')

if argv[1] in ADDABLE.keys():
    ADDABLE[argv[1]].add(options)
else:
    cmd = commands.get_command('add', 'git-python-gtk')
    templatetools.usage_error(_(
        'Cannot add, did not recognize plugin name: %s' % argv[1]),
                              cmd=cmd,
                              template='git-python-gtk')
    sys.exit(4)
Beispiel #17
0
            pass
    help_text = "\n\n".join(help_list)
    print help_text


def shell_completion(argv):
    """ Complete args """
    # option completion
    rv = []
    if len(argv) == 1:
        rv = options.keys()
    if rv:
        rv.sort()
        print " ".join(rv)


templatetools.handle_additional_parameters(sys.argv, help, shell_completion, usage=usage)

if len(sys.argv) < 2:
    cmd = commands.get_command("add", "git-python-gtk")
    templatetools.usage_error(_("Cannot add, no plugin name provided."), cmd=cmd, template="git-python-gtk")

if argv[1] in ADDABLE.keys():
    ADDABLE[argv[1]].add(options)
else:
    cmd = commands.get_command("add", "git-python-gtk")
    templatetools.usage_error(
        _("Cannot add, did not recognize plugin name: %s" % argv[1]), cmd=cmd, template="git-python-gtk"
    )
    sys.exit(4)
    if rv:
        rv.sort()
        print ' '.join(rv)

templatetools.handle_additional_parameters(sys.argv, help, shell_completion, usage=usage)

for_extras = False
i = 0

while i < len(sys.argv):
    arg = sys.argv[i]
    if arg.startswith('-'):
        if arg == '--extras':
            for_extras = True
        else:
            cmd = commands.get_command('package', 'git-python-gtk')
            templatetools.usage_error(_("Unknown option: %s."  % arg), cmd=cmd)
    i += 1

# retrieve useful information
if not configurationhandler.project_config:
    configurationhandler.loadConfig()
project_name = configurationhandler.project_config['project']

try:
    release_version = quicklyutils.get_setup_value('version')
except quicklyutils.cant_deal_with_setup_value:
    print _("Release version not found in setup.py.")


# creation/update debian packaging
templatetools.handle_additional_parameters(sys.argv,
                                           help,
                                           shell_completion,
                                           usage=usage)

for_extras = False
i = 0

while i < len(sys.argv):
    arg = sys.argv[i]
    if arg.startswith('-'):
        if arg == '--extras':
            for_extras = True
        else:
            cmd = commands.get_command('package', 'git-python-gtk')
            templatetools.usage_error(_("Unknown option: %s." % arg), cmd=cmd)
    i += 1

# retrieve useful information
if not configurationhandler.project_config:
    configurationhandler.loadConfig()
project_name = configurationhandler.project_config['project']

try:
    release_version = quicklyutils.get_setup_value('version')
except quicklyutils.cant_deal_with_setup_value:
    print _("Release version not found in setup.py.")

# creation/update debian packaging
if packaging.updatepackaging(no_changelog=True, installopt=for_extras) != 0:

def shell_completion(argv):
    """Propose available license as the third parameter"""

    # if then license argument given, returns available licenses
    if len(argv) == 1:
        rv = get_supported_licenses()
        rv.sort()
        print ' '.join(rv)


if __name__ == "__main__":

    templatetools.handle_additional_parameters(sys.argv,
                                               help,
                                               shell_completion,
                                               usage=usage)
    license = None
    if len(sys.argv) > 2:
        cmd = commands.get_command('license', 'git-python-gtk')
        templatetools.usage_error(
            _("This command only take one optional argument."), cmd=cmd)
    if len(sys.argv) == 2:
        license = sys.argv[1]
    try:
        licensing(license)
    except LicenceError, error_message:
        print(error_message)
        sys.exit(1)
launchpad = None
project = None
ppa_name = None
i = 0
args = []
argv = sys.argv

while i < len(argv):
    arg = argv[i]
    if arg.startswith('-'):
        if arg == '--ppa':
            if i + 1 < len(argv):
                ppa_name = argv[i + 1]
                i += 1
            else:
                cmd = commands.get_command('release', 'git-python-gtk')
                templatetools.usage_error(_("No PPA provided."), cmd=cmd)
        else:
            cmd = commands.get_command('release', 'git-python-gtk')
            templatetools.usage_error(_("Unknown option: %s."  % arg), cmd=cmd)
    else:
        args.append(arg)
    i += 1

    commit_msg = None
if len(args) == 1:
    proposed_version = None
elif len(args) == 2:
    proposed_version = args[1]
elif len(args) > 2:
    proposed_version = args[1]
Beispiel #22
0

templatetools.handle_additional_parameters(sys.argv,
                                           help,
                                           shell_completion,
                                           usage=usage)

while i < len(argv):
    arg = argv[i]
    if arg.startswith('-'):
        if arg == '--ppa':
            if i + 1 < len(argv):
                ppa_name = argv[i + 1]
                i += 1
            else:
                cmd = commands.get_command('share', 'git-python-gtk')
                templatetools.usage_error(_("No PPA provided."), cmd=cmd)
        else:
            cmd = commands.get_command('share', 'git-python-gtk')
            templatetools.usage_error(_("Unknown option: %s." % arg), cmd=cmd)
    else:
        args.append(arg)
    i += 1

# warning: project_name can be different from project.name (one local, one on launchpad)
if not configurationhandler.project_config:
    configurationhandler.loadConfig()
project_name = configurationhandler.project_config['project']

# connect to LP
try:
                                     "name", "license", license_content,
                                     {'translatable': 'yes'})
    copy_license_to_files(license_content)


def shell_completion(argv):
    """Propose available license as the third parameter"""
    
    # if then license argument given, returns available licenses
    if len(argv) == 1:
        rv = get_supported_licenses()
        rv.sort()
        print ' '.join(rv)


if __name__ == "__main__":

    templatetools.handle_additional_parameters(sys.argv, help, shell_completion, usage=usage)
    license = None
    if len(sys.argv) > 2:
        cmd = commands.get_command('license', 'ubuntu-application')
        templatetools.usage_error(_("This command only take one optional argument."), cmd=cmd)
    if len(sys.argv) == 2:
        license = sys.argv[1]
    try:
        licensing(license)
    except LicenceError, error_message:
        print(error_message)
        sys.exit(1)

Beispiel #24
0
    for module in ADDABLE.values():
        try:
            help_list.append(module.help_text)
        except AttributeError:
            # ignore files in store that have no help for us
            pass
    help_text = '\n\n'.join(help_list)
    print help_text

def shell_completion(argv):
    ''' Complete args '''
    # option completion
    rv = []
    if len(argv) == 1:
        rv = options.keys()
    if rv:
        rv.sort()
        print ' '.join(rv)
templatetools.handle_additional_parameters(sys.argv, help, shell_completion, usage=usage)

if len(sys.argv) < 2:
    cmd = commands.get_command('add', 'ubuntu-application')
    templatetools.usage_error(_("Cannot add, no plugin name provided."), cmd=cmd, template='ubuntu-application')

if argv[1] in ADDABLE.keys():
    ADDABLE[argv[1]].add(options)
else:
    cmd = commands.get_command('add', 'ubuntu-application')
    templatetools.usage_error(_('Cannot add, did not recognize plugin name: %s' % argv[1]), cmd=cmd, template='ubuntu-application')
    sys.exit(4)
        quicklyutils.change_xml_elem(
            about_dialog_file_name, "object/property", "name", "license", license_content, {"translatable": "yes"}
        )
    copy_license_to_files(license_content)


def shell_completion(argv):
    """Propose available license as the third parameter"""

    # if then license argument given, returns available licenses
    if len(argv) == 1:
        rv = get_supported_licenses()
        rv.sort()
        print " ".join(rv)


if __name__ == "__main__":

    templatetools.handle_additional_parameters(sys.argv, help, shell_completion, usage=usage)
    license = None
    if len(sys.argv) > 2:
        cmd = commands.get_command("license", "git-python-gtk")
        templatetools.usage_error(_("This command only take one optional argument."), cmd=cmd)
    if len(sys.argv) == 2:
        license = sys.argv[1]
    try:
        licensing(license)
    except LicenceError, error_message:
        print (error_message)
        sys.exit(1)
Beispiel #26
0
launchpad = None
project = None
ppa_name = None
i = 0
args = []
argv = sys.argv

while i < len(argv):
    arg = argv[i]
    if arg.startswith('-'):
        if arg == '--ppa':
            if i + 1 < len(argv):
                ppa_name = argv[i + 1]
                i += 1
            else:
                cmd = commands.get_command('release', 'ubuntu-application')
                templatetools.usage_error(_("No PPA provided."), cmd=cmd)
        else:
            cmd = commands.get_command('release', 'ubuntu-application')
            templatetools.usage_error(_("Unknown option: %s."  % arg), cmd=cmd)
    else:
        args.append(arg)
    i += 1

    commit_msg = None
if len(args) == 1:
    proposed_version = None
elif len(args) == 2:
    proposed_version = args[1]
elif len(args) > 2:
    proposed_version = args[1]
    if rv:
        rv.sort()
        print ' '.join(rv)

templatetools.handle_additional_parameters(sys.argv, help, shell_completion, usage=usage)

for_extras = False
i = 0

while i < len(sys.argv):
    arg = sys.argv[i]
    if arg.startswith('-'):
        if arg == '--extras':
            for_extras = True
        else:
            cmd = commands.get_command('package', 'ubuntu-application')
            templatetools.usage_error(_("Unknown option: %s."  % arg), cmd=cmd)
    i += 1

# retrieve useful information
if not configurationhandler.project_config:
    configurationhandler.loadConfig()
project_name = configurationhandler.project_config['project']

try:
    release_version = quicklyutils.get_setup_value('version')
except quicklyutils.cant_deal_with_setup_value:
    print _("Release version not found in setup.py.")


# creation/update debian packaging
launchpad = None
project = None
ppa_name = None
i = 0
args = []
argv = sys.argv

while i < len(argv):
    arg = argv[i]
    if arg.startswith('-'):
        if arg == '--ppa':
            if i + 1 < len(argv):
                ppa_name = argv[i + 1]
                i += 1
            else:
                cmd = commands.get_command('submitubuntu', 'git-python-gtk')
                templatetools.usage_error(_("No PPA provided."), cmd=cmd)
        else:
            cmd = commands.get_command('submitubuntu', 'git-python-gtk')
            templatetools.usage_error(_("Unknown option: %s."  % arg), cmd=cmd)
    else:
        args.append(arg)
    i += 1

    commit_msg = None
if len(args) == 1:
    proposed_version = None
elif len(args) == 2:
    proposed_version = args[1]
elif len(args) > 2:
    proposed_version = args[1]