~certify-web-dev/twisted/certify-staging

« back to all changes in this revision

Viewing changes to twisted/application/app.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-01-02 19:38:17 UTC
  • mfrom: (2.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100102193817-jphp464ppwh7dulg
Tags: 9.0.0-1
* python-twisted: Depend on the python-twisted-* 9.0 packages.
* python-twisted: Depend on python-zope.interface only. Closes: #557781.

Show diffs side-by-side

added added

removed removed

Lines of Context:
237
237
        If an L{ILogObserver} component has been set on C{application}, then
238
238
        it will be used as the log observer.  Otherwise a log observer will be
239
239
        created based on the command-line options.
240
 
        
 
240
 
241
241
        @param application: The application on which to check for an
242
242
            L{ILogObserver}.
243
243
        """
498
498
 
499
499
def getApplication(config, passphrase):
500
500
    s = [(config[t], t)
501
 
           for t in ['python', 'xml', 'source', 'file'] if config[t]][0]
 
501
           for t in ['python', 'source', 'file'] if config[t]][0]
502
502
    filename, style = s[0], {'file':'pickle'}.get(s[1],s[1])
503
503
    try:
504
504
        log.msg("Loading %s..." % filename)
581
581
 
582
582
class ServerOptions(usage.Options, ReactorSelectionMixin):
583
583
 
 
584
    longdesc = ("twistd reads a twisted.application.service.Application out "
 
585
                "of a file and runs it.")
 
586
 
584
587
    optFlags = [['savestats', None,
585
588
                 "save the Stats object rather than the text output of "
586
589
                 "the profiler."],
587
590
                ['no_save','o',   "do not save state on shutdown"],
588
591
                ['encrypted', 'e',
589
 
                 "The specified tap/aos/xml file is encrypted."],
 
592
                 "The specified tap/aos file is encrypted."],
590
593
                ['nothotshot', None,
591
594
                 "DEPRECATED. Don't use the hotshot profiler even if "
592
595
                 "it's available."]]
603
606
                     ['python','y', None,
604
607
                      "read an application from within a Python file "
605
608
                      "(implies -o)"],
606
 
                     ['xml', 'x', None,
607
 
                      "Read an application from a .tax file "
608
 
                      "(Marmalade format)."],
609
609
                     ['source', 's', None,
610
610
                      "Read an application from a .tas file (AOT format)."],
611
611
                     ['rundir','d','.',
619
619
 
620
620
    #zsh_altArgDescr = {"foo":"use this description for foo instead"}
621
621
    #zsh_multiUse = ["foo", "bar"]
622
 
    zsh_mutuallyExclusive = [("file", "python", "xml", "source")]
 
622
    zsh_mutuallyExclusive = [("file", "python", "source")]
623
623
    zsh_actions = {"file":'_files -g "*.tap"',
624
624
                   "python":'_files -g "*.(tac|py)"',
625
 
                   "xml":'_files -g "*.tax"',
626
625
                   "source":'_files -g "*.tas"',
627
626
                   "rundir":"_dirs"}
628
627
    #zsh_actionDescr = {"logfile":"log file name", "random":"random seed"}