~trbs/phatch/multiprocessing

« back to all changes in this revision

Viewing changes to phatch/app.py

  • Committer: trbs
  • Date: 2009-06-15 01:28:21 UTC
  • Revision ID: trbs-20090615012821-aanxim44kankcapz
initial commit for multiprocessing patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
        dest    = "verbose", 
111
111
        default = False,
112
112
        help    = _("Verbose"))
 
113
    parser.add_option("--processes", action="store",
 
114
        type    = "int",
 
115
        dest    = "nr_of_consumers",
 
116
        default = -1,
 
117
        help    = _("Number of images processed simultaneously"))
 
118
    parser.add_option("--threads", action="store_true", 
 
119
        dest    = "force_threads", 
 
120
        default = False,
 
121
        help    = _("Explicitly use threads even when multiprocessing is available"))
113
122
    options, paths = parser.parse_args()
114
123
    paths   = [fix_path(path) for path in paths if path and path[0]!= '%']
115
124
    return options, paths
165
174
    options, paths  = parse_options()
166
175
    from core.settings import create_settings
167
176
    settings        = create_settings(config_paths,options)
 
177
    if settings['force_threads']:
 
178
        import __main__
 
179
        __main__.FORCE_THREADS = True
168
180
    if settings['image_inspector']:
169
181
        _inspect(app_file,paths)
170
182
        return