2012-03-10 195 views
0

我正在研究一個我繼承的扭曲程序。我有一些目前在tap.py文件中的代碼,但不屬於那裏。我將它移出到同一個目錄中的自己的文件中,但是現在輕敲文件找不到這些類。我將如何去解決這個問題?當我提到python/twisted的時候,我很綠,所以不要以爲因爲某些東西很平凡,我沒有看過它。使用扭曲

Traceback (most recent call last): 
    File "/usr/local/bin/twistd", line 5, in <module> 
    pkg_resources.run_script('Twisted==10.2.0', 'twistd') 
    File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 461, in run_script 
    self.require(requires)[0].run_script(script_name, ns) 
    File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1194, in run_script 
    execfile(script_filename, namespace, namespace) 
    File "/usr/local/lib/python2.6/dist-packages/Twisted-10.2.0-py2.6-linux-i686.egg/EGG-INFO/scripts/twistd", line 19, in <module> 
    run() 
    File "/usr/local/lib/python2.6/dist-packages/Twisted-10.2.0-py2.6-linux-i686.egg/twisted/scripts/twistd.py", line 27, in run 
    app.run(runApp, ServerOptions) 
    File "/usr/local/lib/python2.6/dist-packages/Twisted-10.2.0-py2.6-linux-i686.egg/twisted/application/app.py", line 631, in run 
    runApp(config) 
    File "/usr/local/lib/python2.6/dist-packages/Twisted-10.2.0-py2.6-linux-i686.egg/twisted/scripts/twistd.py", line 23, in runApp 
    _SomeApplicationRunner(config).run() 
    File "/usr/local/lib/python2.6/dist-packages/Twisted-10.2.0-py2.6-linux-i686.egg/twisted/application/app.py", line 374, in run 
    self.application = self.createOrGetApplication() 
    File "/usr/local/lib/python2.6/dist-packages/Twisted-10.2.0-py2.6-linux-i686.egg/twisted/application/app.py", line 434, in createOrGetApplication 
    ser = plg.makeService(self.config.subOptions) 
    File "/usr/local/lib/python2.6/dist-packages/lister-0.0dev_r207-py2.6.egg/lister/mailer/tap.py", line 84, in makeService 
    smtpFactory = SmtpDaemonFactory() 
NameError: global name 'SmtpDaemonFactory' is not defined 

回答

2

好吧,我覺得有點傻。我通過使用正確的導入來修復它。