~oswald/p1tr/yoP1tr

« back to all changes in this revision

Viewing changes to bot.py

  • Committer: Christian Ortner
  • Date: 2008-03-30 20:46:53 UTC
  • Revision ID: chris.ortner@gmail.com-20080330204653-1z93qsgqs73pc7x3
ResolvedĀ bugĀ #208954

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
-ho <host>          - specify host used for server identification"""
33
33
 
34
34
def main():
35
 
    # Load configuration
36
 
    servers = load_config()
37
 
    
38
 
    # Loads plug-ins and plug-in handlers
39
 
    plugs = plugins.PluginLoader().load_plugins()
40
 
    handler = plugins.PluginHandler(plugs)
41
 
    
42
 
    for srv in servers:
43
 
        srv.connect(handler)
44
 
    
45
 
    reactor.run()
46
 
 
47
 
main()
48
 
 
49
 
# Exit gracefully
50
 
print _('This P1tr run went through without problems.')
 
35
    try:
 
36
        # Get to p1tr dir
 
37
        os.chdir(os.path.dirname(os.path.abspath(__file__)))
 
38
        # Load configuration
 
39
        servers = load_config()
 
40
        
 
41
        # Loads plug-ins and plug-in handlers
 
42
        plugs = plugins.PluginLoader().load_plugins()
 
43
        handler = plugins.PluginHandler(plugs)
 
44
        
 
45
        for srv in servers:
 
46
            srv.connect(handler)
 
47
        
 
48
        reactor.run()
 
49
    except KeyboardInterrupt:
 
50
        reactor.stop()
 
51
 
 
52
if __name__ == "__main__":
 
53
    main()
 
 
b'\\ No newline at end of file'