Ejemplo n.º 1
0
def add(options):
    if len(argv) != 2:
        templatetools.print_usage(options['indicator'])
        sys.exit(4)

    abs_template_path = templatetools.get_template_path_from_project()
    abs_command_path = os.path.abspath(os.path.dirname(sys.argv[0]))

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

    template_python_dir = os.path.join(abs_template_path, 'store', 'python')
    # take files from command directory if don't exist
    python_file = os.path.join(template_python_dir, 'indicator.py')
    python_name = templatetools.python_name(project_name)
    target_python_dir = python_name

    project_sentence_name, project_camel_case_name = \
        templatetools.conventional_names(project_name)

    substitutions = (("project_name", project_name), ("python_name",
                                                      python_name))

    templatetools.file_from_template(template_python_dir, "indicator.py",
                                     target_python_dir, substitutions)
Ejemplo n.º 2
0
def add(options):
    if len(argv) != 2:
        templatetools.print_usage(options['indicator'])
        sys.exit(4)

    abs_template_path = templatetools.get_template_path_from_project()
    abs_command_path = os.path.abspath(os.path.dirname(sys.argv[0]))

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

    template_python_dir = os.path.join(abs_template_path, 'store', 'python')
    # take files from command directory if don't exist
    python_file = os.path.join(template_python_dir,
                               'indicator.py')
    python_name = templatetools.python_name(project_name)
    target_python_dir = python_name

    project_sentence_name, project_camel_case_name = \
        templatetools.conventional_names(project_name)

    substitutions = (("project_name",project_name),
                    ( "python_name",python_name))

    templatetools.file_from_template(template_python_dir, 
                                    "indicator.py", 
                                    target_python_dir, 
                                    substitutions)
Ejemplo n.º 3
0
def add(options):
    if len(argv) != 3:
        templatetools.print_usage(options['help-topic'])
        sys.exit(4)

    try:
        topic_name = templatetools.quickly_name(argv[2])
    except templatetools.bad_project_name, e:
        print(e)
        sys.exit(1)
Ejemplo n.º 4
0
def add(options):
    if len(argv) != 3:
        templatetools.print_usage(options['dialog'])
        sys.exit(4)

    try:
        dialog_name = templatetools.quickly_name(argv[2])
    except templatetools.bad_project_name, e:
        print(e)
        sys.exit(1)
Ejemplo n.º 5
0
def usage():
    templatetools.print_usage(
        _('quickly submitubuntu [--ppa <ppa | group/ppa>] [release-version] [comments]'
          ))
Ejemplo n.º 6
0
def usage():
    templatetools.print_usage(_('quickly run -- [program arguments]'))
Ejemplo n.º 7
0
def usage():
    templatetools.print_usage(_('quickly create <template> <project-name>'))
Ejemplo n.º 8
0
def usage():
    templatetools.print_usage('quickly package [--extras]')
Ejemplo n.º 9
0
def usage():
    templatetools.print_usage('quickly edit')
Ejemplo n.º 10
0
def usage():
    templatetools.print_usage(_('quickly share [--ppa <ppa | group/ppa>]'))
Ejemplo n.º 11
0
def usage():
    templatetools.print_usage(_('quickly license [license-name]'))
    licenses = get_supported_licenses()
    licenses.sort()
    print _('Candidate licenses: %s') % ', '.join(licenses + ['other'])
Ejemplo n.º 12
0
def usage():
    templatetools.print_usage('quickly upgrade')
Ejemplo n.º 13
0
def usage():
    templatetools.print_usage(options.values())
Ejemplo n.º 14
0
def usage():
    templatetools.print_usage(options.values())
Ejemplo n.º 15
0
                                           project.name)
    except launchpadaccess.launchpad_project_error, e:
        print(e)
        sys.exit(1)
    # get the project now and save the url into setup.py
    project_url = launchpadaccess.launchpad_url + '/' + project.name
    quicklyutils.set_setup_value('url', project_url)
    about_dialog_file_name = quicklyutils.get_about_file_name()
    if about_dialog_file_name:
        quicklyutils.change_xml_elem(about_dialog_file_name, "object/property",
                                     "name", "website", project_url, {})

# change default ppa
elif argv[1] == "ppa":
    if len(argv) != 3:
        templatetools.print_usage(options['ppa'])
        print _("\nUse shell completion to find all available PPAs")
        sys.exit(4)

    # connect to LP
    try:
        launchpad = launchpadaccess.initialize_lpi()
    except launchpadaccess.launchpad_connection_error, e:
        print(e)
        sys.exit(1)

    ppa_name = argv[2]
    # choose right ppa parameter (users, etc.) ppa or staging
    try:
        (ppa_user, ppa_name, dput_ppa_name,
         ppa_url) = packaging.choose_ppa(launchpad, ppa_name)
Ejemplo n.º 16
0
def usage():
    templatetools.print_usage(_('quickly license [license-name]'))
    licenses = get_supported_licenses()
    licenses.sort()
    print _('Candidate licenses: %s') % ', '.join(licenses + ['other'])
Ejemplo n.º 17
0
        internal.apportutils.update_apport(quickly_project_name, previous_lp_project_name, project.name)
    except launchpadaccess.launchpad_project_error, e:
        print(e)
        sys.exit(1)
    # get the project now and save the url into setup.py
    project_url  = launchpadaccess.launchpad_url + '/' + project.name
    quicklyutils.set_setup_value('url', project_url)
    about_dialog_file_name = quicklyutils.get_about_file_name()
    if about_dialog_file_name:
        quicklyutils.change_xml_elem(about_dialog_file_name, "object/property",
                                     "name", "website", project_url, {})

# change default ppa
elif argv[1] == "ppa":
    if len(argv) != 3:
        templatetools.print_usage(options['ppa'])
        print _("\nUse shell completion to find all available PPAs")
        sys.exit(4)

    # connect to LP
    try:
        launchpad = launchpadaccess.initialize_lpi()
    except launchpadaccess.launchpad_connection_error, e:
        print(e)
        sys.exit(1)

    ppa_name = argv[2]
    # choose right ppa parameter (users, etc.) ppa or staging
    try:
        (ppa_user, ppa_name, dput_ppa_name, ppa_url) = packaging.choose_ppa(launchpad, ppa_name)
    except packaging.user_team_not_found, e:
Ejemplo n.º 18
0
def usage():
    templatetools.print_usage('quickly design')
Ejemplo n.º 19
0
def usage():
    templatetools.print_usage(_("quickly license [license-name]"))
    licenses = get_supported_licenses()
    licenses.sort()
    print _("Candidate licenses: %s") % ", ".join(licenses + ["other"])
Ejemplo n.º 20
0
def usage():
    templatetools.print_usage(_('quickly debug -- [program arguments]'))
Ejemplo n.º 21
0
def usage():
    templatetools.print_usage(_('quickly save [comments]'))
Ejemplo n.º 22
0
def usage():
    templatetools.print_usage(_('quickly save [comments]'))
Ejemplo n.º 23
0
def usage():
    templatetools.print_usage('quickly package [--extras]')
Ejemplo n.º 24
0
def usage():
    templatetools.print_usage("quickly tutorial")
Ejemplo n.º 25
0
def usage():
    templatetools.print_usage('quickly tutorial')
Ejemplo n.º 26
0
def usage():
    templatetools.print_usage('quickly test')
Ejemplo n.º 27
0
def usage():
    templatetools.print_usage(_('quickly submitubuntu [--ppa <ppa | group/ppa>] [release-version] [comments]'))
Ejemplo n.º 28
0
def usage():
    templatetools.print_usage('quickly design')
Ejemplo n.º 29
0
def usage():
    templatetools.print_usage(_('quickly create <template> <project-name>'))
Ejemplo n.º 30
0
def usage():
    templatetools.print_usage(_('quickly share [--ppa <ppa | group/ppa>]'))