示例#1
0
 def _init_local(self):
     from p2p import commands
     from lib import net_misc
     from lib import misc
     from system import tmpfile
     from system import run_upnpc
     from raid import eccmap
     from userid import my_id
     from crypt import my_keys
     my_id.init()
     if settings.enableWebStream():
         from logs import weblog
         weblog.init(settings.getWebStreamPort())
     if settings.enableWebTraffic():
         from logs import webtraffic
         webtraffic.init(port=settings.getWebTrafficPort())
     misc.init()
     commands.init()
     tmpfile.init(settings.getTempDir())
     net_misc.init()
     settings.update_proxy_settings()
     run_upnpc.init()
     eccmap.init()
     my_keys.init()
     if sys.argv.count('--twisted'):
         from twisted.python import log as twisted_log
         twisted_log.startLogging(MyTwistedOutputLog(), setStdout=0)
         # import twisted.python.failure as twisted_failure
         # twisted_failure.startDebugMode()
         # twisted_log.defaultObserver.stop()
     if settings.getDebugLevel() > 10:
         defer.setDebugging(True)
示例#2
0
 def _init_local(self):
     from p2p import commands
     from lib import net_misc
     from lib import misc
     from system import tmpfile
     from system import run_upnpc
     from raid import eccmap
     from contacts import identitydb
     from crypt import my_keys
     from userid import id_url
     from userid import my_id
     id_url.init()
     identitydb.init()
     my_id.init()
     if settings.enableWebStream():
         try:
             from logs import weblog
             weblog.init(settings.getWebStreamPort())
         except:
             lg.exc()
     if settings.enableWebTraffic():
         try:
             from logs import webtraffic
             webtraffic.init(port=settings.getWebTrafficPort())
         except:
             lg.exc()
     misc.init()
     commands.init()
     tmpfile.init(settings.getTempDir())
     net_misc.init()
     settings.update_proxy_settings()
     run_upnpc.init()
     eccmap.init()
     my_keys.init()
     # if sys.argv.count('--twisted'):
     #     from twisted.python import log as twisted_log
     #     twisted_log.startLogging(MyTwistedOutputLog(), setStdout=0)
         # import twisted.python.failure as twisted_failure
         # twisted_failure.startDebugMode()
         # twisted_log.defaultObserver.stop()
     # if settings.getDebugLevel() > 10:
     #     defer.setDebugging(True)
     if settings.enableMemoryProfile():
         try:
             from guppy import hpy  # @UnresolvedImport
             hp = hpy()
             hp.setrelheap()
             if _Debug:
                 lg.out(_DebugLevel, 'hp.heap():\n'+str(hp.heap()))
                 lg.out(_DebugLevel, 'hp.heap().byrcs:\n'+str(hp.heap().byrcs))
                 lg.out(_DebugLevel, 'hp.heap().byvia:\n'+str(hp.heap().byvia))
         except:
             if _Debug:
                 lg.out(_DebugLevel, "guppy package is not installed")
     if _Debug:
         lg.dbg(_DebugLevel, 'all local modules are initialized, ready to start the engine')
def main():
    import pprint
    my_keys.init()
    init()
    pprint.pprint(list(query_messages(
        # sender_id='',
        recipient_id='[email protected]',
        # offset=2,
        # limit=3,
        message_types=['group_message', ]
    )))
    # pprint.pprint(list(list_conversations(
        # message_types=['group_message', ]
    # )))
    shutdown()