~ubuntu-branches/ubuntu/natty/quickly/natty

« back to all changes in this revision

Viewing changes to data/templates/ubuntu-application/project_root/bin/project_name

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-03-29 19:00:48 UTC
  • mfrom: (8.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100329190048-olhobq492x3xnztz
Tags: 0.3.90-0ubuntu1
* New release:
  Quickly core:
  - check now that --template has one argument
  - -- enables to give options to templates (unknown options and arguments
    are still given to templates but -- specify explicity what to give to
    templates commands like -h, --version...)
  - check and enable recreation of the credential if user deletes it on
    Launchpad
  - Use realpath so that we can symlink to the binary in trunk.
    (Jonathan Lange)
  - project_path_not_found is raised when data_path_not_found should be
    (originated from Philip Peitsch's patch). (LP: #497688)
  - importing command in one template from another template is now possible
    support as well "all" keyword to import all commands from a template
    into another one (take care of overridden commands too)
    (LP: #452306, #487301)
  - add an apport hook to get installed templates (LP: #411127)
  - enable option completion for templates
  - handle now version upgrade, launching script for templates and handling
    versionning on them
  - change getstarted wording (LP: #486180) - Grant
  - Quickly ship now "version" tag instead of "format" tag
  - add some templatetools to check X display
  - if a commands exit with 4, do not show "ERROR:" (case of wrong command
    usage, for instance)
  - Rewrote importing module in both bin/quickly and ubuntu-project binary
  - Add get_camel_case_name() and get_sentence_name() to templatetools
  - Refactor some code in pre_create hook()
  - Now dashes and spaces support in project name! Dealing with python and
    packaging issues for you. (LP: #493130)
  - Provide Quickly API (LP: #426480)
  - Fix some issues in the man page
  ubuntu-application Template:
  - Enabling upload to team or user ppa, as well as any ppa.
    Use --ppa ppaname or --ppa team/ppaname
    .quickly file can be used as well with ppa = ppaname or
    ppa = team/ppaname (LP: #470192)
    ppa completion is also available
  - Change BSD header by full license
  - Add MIT license
  - Fixes an error when launchpad display name contains unicode character
    (Petar Vasić)
  - Fix typo in quickly help save (Petar Vasić)
  - Adds logo.png as logo property in about dialog (LP: #478389)
    (Petar Vasić)
  - Remove lp-project-change command and add configure command.
    configure lp-project [project_name] to set/reset lp project binded to
    your Quickly project
    ppa <ppa name> to set a default ppa with your project
  - Fix ~/.selected-editor being ignored (LP: #484730)
  - Fix wrong shell completion when in a template (it wrongly proposed
    all commands followed by templates)
  - Check if we have a X display available before running "run" or launching
    GUI in "create" command.
  - add -- support in quickly run to pass options like --help, --version so
    that Quickly core don't take them.
  - enable preferences save call being called multiple times (Philip Peitsch)
  - Use realpath so that we can symlink to the binary in trunk.
  - Fixed some errors in the tutorial (Brian) (LP: #499356)
  - Fix missing import sys in setup.py (Philip Peitsch) (LP: #499712)
  - rename ubuntu-project to ubuntu-application
  - enhance quickly license (no more Copyright file, only one AUTHORS file)
    personal license needs COPYING file now (and the header will be copied in
    every files). No more # needed in those files too. Some other little
    refactoring too (LP: #469330)
  - autolicence by default on first share/release (with LP info and on GPL-3)
  - change versionning support in ubuntu application: (LP: #476814)
   + quickly share just adds -publicX to current version where X is bumped
     at each "quicky share" execution
   + quickly release remove -publicX (if any) and release with current YY.MM.
     If there is already a release with that version, it will be YY.MM.1, 
     then YY.MM.2
  - add accelerators to menu items (jens persson)
  - set correctly title dialog (Philip Peitsch) (LP: #501999)
  - about dialog box is now fully automated: (LP: #478414)
   + update copyright, authors, license (when licensing)
   + version (when sharing and releasing)
   + homepage (when changing launchpad project: release and configure)
  - add an 'add' command. $ quickly dialog … is now $ quickly add dialog …
    (LP: #438320)
  - enable automatic release and milestone built in LP, releasing and pushing
    upstream tarball (LP: #470344)
  - automatic collect and publish changelog message from commits and save
    messages used during devlopment. (LP: #476572)
  - add i18n to boiler plate (LP: #423529)
  - enable adding manual depdencies to quickly project (LP: #474639)
  - enable configure its own bzr branch and resetting parent branch even once
    already configured (quickly configure bzr <branch-path>)
  - now recommends seahorse-plugins to have a graphical prompt for signing
    package
  - rename quickly glade to quickly design (LP: #528664)
  - create command is now more flexible and enable people to inherit from
    other template more easily
  - add translation domain to gtkbuilder and fix some items that shouldn't
    been translatable (Łukasz Jernaś)
  - add apport and launchpadintegration to new and existing project once
    bounded to LP (Philip Peitsch)
  - fix spelling mistake "connexion" (Łukasz Jernaś) (LP: #532667)
  - the ubuntu-application tutorial is now internationalized and use docbook
    format. Translators, it's yours! (Shane Fagan) (LP: #525168)
  - package/share/release are now more quiet and only print something on error
    warning as a summary as with unfound packages, and so on (LP: #482915)
  - new algorithm to select good email automatically. Try to get the preferred
    email and update the AUTHOR file with it.
  - test GPG key and create one automatically if none is available. The
    corresponding public key availabity in launchpad is also checked.
    (LP: #427730, #408993)
  - add devscripts as a dependency (bug #465833), will fix all the depends
    mess later
  - bump python-distutils-extra (>= 2.18bzr1)
  ubuntu-cli Template:
  - first release using import command feature (no command written into the
    template itself). This is a basic ubuntu CLI application
  ubuntu-pygame Template:
  - first release using import command feature. python-pygame added as a
    depends
* debian/control:
  - renamed and separate in multiple packages to get a -common used with
    Quickly widgets (LP: #519633)
  - suggests python-quickly-widgets

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
# -*- coding: utf-8 -*-
 
3
### BEGIN LICENSE
 
4
# This file is in the public domain
 
5
### END LICENSE
 
6
 
 
7
import sys
 
8
import os
 
9
import gtk
 
10
 
 
11
import gettext
 
12
from gettext import gettext as _
 
13
gettext.textdomain('project_name')
 
14
 
 
15
# optional Launchpad integration
 
16
# this shouldn't crash if not found as it is simply used for bug reporting
 
17
try:
 
18
    import LaunchpadIntegration
 
19
    launchpad_available = True
 
20
except:
 
21
    launchpad_available = False
 
22
 
 
23
# Add project root directory (enable symlink, and trunk execution).
 
24
PROJECT_ROOT_DIRECTORY = os.path.abspath(
 
25
    os.path.dirname(os.path.dirname(os.path.realpath(sys.argv[0]))))
 
26
 
 
27
if (os.path.exists(os.path.join(PROJECT_ROOT_DIRECTORY, 'python_name'))
 
28
    and PROJECT_ROOT_DIRECTORY not in sys.path):
 
29
    sys.path.insert(0, PROJECT_ROOT_DIRECTORY)
 
30
    os.putenv('PYTHONPATH', PROJECT_ROOT_DIRECTORY) # for subprocesses
 
31
 
 
32
from python_name import (
 
33
    Aboutcamel_case_nameDialog, Preferencescamel_case_nameDialog)
 
34
from python_name.helpers import get_builder
 
35
 
 
36
 
 
37
class camel_case_nameWindow(gtk.Window):
 
38
    __gtype_name__ = "camel_case_nameWindow"
 
39
    
 
40
    # To construct a new instance of this method, the following notable 
 
41
    # methods are called in this order:
 
42
    # __new__(cls)
 
43
    # __init__(self)
 
44
    # finish_initializing(self, builder)
 
45
    # __init__(self)
 
46
    #
 
47
    # For this reason, it's recommended you leave __init__ empty and put
 
48
    # your inialization code in finish_intializing
 
49
    
 
50
    def __new__(cls):
 
51
        """Special static method that's automatically called by Python when 
 
52
        constructing a new instance of this class.
 
53
        
 
54
        Returns a fully instantiated camel_case_nameWindow object.
 
55
        """
 
56
        builder = get_builder('camel_case_nameWindow')
 
57
        new_object = builder.get_object("python_name_window")
 
58
        new_object.finish_initializing(builder)
 
59
        return new_object
 
60
 
 
61
    def finish_initializing(self, builder):
 
62
        """Called while initializing this instance in __new__
 
63
 
 
64
        finish_initalizing should be called after parsing the UI definition
 
65
        and creating a camel_case_nameWindow object with it in order to finish
 
66
        initializing the start of the new camel_case_nameWindow instance.
 
67
        
 
68
        Put your initilization code in here and leave __init__ undefined.
 
69
        """
 
70
        # Get a reference to the builder and set up the signals.
 
71
        self.builder = builder
 
72
        self.builder.connect_signals(self)
 
73
 
 
74
        global launchpad_available
 
75
        if launchpad_available:
 
76
            # see https://wiki.ubuntu.com/UbuntuDevelopment/Internationalisation/Coding for more information
 
77
            # about LaunchpadIntegration
 
78
            helpmenu = self.builder.get_object('helpMenu')
 
79
            if helpmenu:
 
80
                LaunchpadIntegration.set_sourcepackagename('project_name')
 
81
                LaunchpadIntegration.add_items(helpmenu, 0, False, True)
 
82
            else:
 
83
                launchpad_available = False
 
84
 
 
85
        # Uncomment the following code to read in preferences at start up.
 
86
        #dlg = Preferencescamel_case_nameDialog.NewPreferencescamel_case_nameDialog()
 
87
        #self.preferences = dlg.get_preferences()
 
88
 
 
89
        # Code for other initialization actions should be added here.
 
90
 
 
91
    def about(self, widget, data=None):
 
92
        """Display the about box for project_name."""
 
93
        about = Aboutcamel_case_nameDialog.Aboutcamel_case_nameDialog()
 
94
        response = about.run()
 
95
        about.destroy()
 
96
 
 
97
    def preferences(self, widget, data=None):
 
98
        """Display the preferences window for project_name."""
 
99
        prefs = Preferencescamel_case_nameDialog.Preferencescamel_case_nameDialog()
 
100
        response = prefs.run()
 
101
        if response == gtk.RESPONSE_OK:
 
102
            # Make any updates based on changed preferences here.
 
103
            pass
 
104
        prefs.destroy()
 
105
 
 
106
    def quit(self, widget, data=None):
 
107
        """Signal handler for closing the camel_case_nameWindow."""
 
108
        self.destroy()
 
109
 
 
110
    def on_destroy(self, widget, data=None):
 
111
        """Called when the camel_case_nameWindow is closed."""
 
112
        # Clean up code for saving application state should be added here.
 
113
        gtk.main_quit()
 
114
 
 
115
if __name__ == "__main__":
 
116
    # Support for command line options.
 
117
    import logging
 
118
    import optparse
 
119
    parser = optparse.OptionParser(version="%prog %ver")
 
120
    parser.add_option(
 
121
        "-v", "--verbose", action="store_true", dest="verbose",
 
122
        help=_("Show debug messages"))
 
123
    (options, args) = parser.parse_args()
 
124
 
 
125
    # Set the logging level to show debug messages.
 
126
    if options.verbose:
 
127
        logging.basicConfig(level=logging.DEBUG)
 
128
        logging.debug('logging enabled')
 
129
 
 
130
    # Run the application.
 
131
    window = camel_case_nameWindow()
 
132
    window.show()
 
133
    gtk.main()