~ubuntu-branches/debian/stretch/phatch/stretch

« back to all changes in this revision

Viewing changes to phatch/app.py

  • Committer: Bazaar Package Importer
  • Author(s): Stani M
  • Date: 2009-10-15 18:22:54 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20091015182254-fu9tucj6k2zk8095
Tags: 0.2.4-1
* Upstream bugfix release (Closes LP: #450693, #449404, #452261,
  #448993)
  
* debian/control: added for phatch: Replaces: phatch-cli (<= 0.2.3-2)
  to fix file overwrite errors (LP: #450800)

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
  phatch --droplet recent"""%_('Examples'),
64
64
        version = VERSION,
65
65
    )
66
 
    parser.add_option("-b", "--base", action="store",
67
 
        dest = "base",
68
 
        default = 0,
69
 
        type = "int",
70
 
        help = _("Start counting from this number"))
71
66
    parser.add_option("-c", "--console", action="store_true",
72
67
        dest = "console",
73
68
        default = False,
145
140
    main(config_paths, app_file=None, gui=True)
146
141
 
147
142
 
 
143
PYWX_ERROR ="""\
 
144
Only the command line package 'phatch-cli' seems to be installed.
 
145
Please install the graphical user interface package 'phatch' as well.
 
146
"""
 
147
 
 
148
 
 
149
def import_pyWx():
 
150
    try:
 
151
        from pyWx import gui
 
152
    except ImportError:
 
153
        sys.exit(PYWX_ERROR)
 
154
    return gui
 
155
 
 
156
 
148
157
def _gui(app_file, paths, settings):
149
158
    reexec_with_pythonw(app_file) #ensure pythonw for mac
150
 
    from pyWx import gui
 
159
    gui = import_pyWx()
151
160
    if paths:
152
161
        actionlist = paths[0]
153
162
    else:
163
172
 
164
173
def _inspect(app_file, paths):
165
174
    reexec_with_pythonw(app_file) #ensure pythonw for mac
166
 
    from pyWx import gui
 
175
    gui = import_pyWx()
167
176
    gui.inspect(paths)
168
177
 
169
178
 
170
179
def _droplet(app_file, paths, settings):
171
180
    reexec_with_pythonw(app_file) #ensure pythonw for mac
172
 
    from pyWx import gui
 
181
    gui = import_pyWx()
173
182
    gui.drop(actionlist=paths[0], paths=paths[1:], settings=settings)
174
183
 
175
184