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

        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()
        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)
 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)
Exemple #3
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')
Exemple #4
0
    import pprint
    pprint.pprint(backup_fs.fsID())
    pprint.pprint(backup_fs.fs())
    print backup_fs.GetByID('0')
    # pprint.pprint(backup_fs.WalkByID('0/0/2/19/F20140106100849AM'))
    # for pathID, localPath, item in backup_fs.IterateIDs():
    #     print pathID, misc.unicode_to_str_safe(localPath)
    # backup_fs.TraverseByIDSorted(lambda x, y, z: sys.stdout.write('%s %s\n' % (x,misc.unicode_to_str_safe(y))))


def test2():
    """
    For tests.
    """
    # reactor.callLater(1, StartDirRecursive, 'c:/temp')
    reactor.run()

#------------------------------------------------------------------------------


if __name__ == "__main__":
    bpio.init()
    lg.set_debug_level(20)
    settings.init()
    tmpfile.init(settings.getTempDir())
    contactsdb.init()
    eccmap.init()
    key.InitMyKey()
    init()
    test()
#    print backup_fs.sizebackups()
    import pprint
    pprint.pprint(backup_fs.fsID())
    pprint.pprint(backup_fs.fs())
    print backup_fs.GetByID('0')
    # pprint.pprint(backup_fs.WalkByID('0/0/2/19/F20140106100849AM'))
    # for pathID, localPath, item in backup_fs.IterateIDs():
    #     print pathID, misc.unicode_to_str_safe(localPath)
    # backup_fs.TraverseByIDSorted(lambda x, y, z: sys.stdout.write('%s %s\n' % (x,misc.unicode_to_str_safe(y))))


def test2():
    """
    For tests.
    """
    # reactor.callLater(1, StartDirRecursive, 'c:/temp')
    reactor.run()

#------------------------------------------------------------------------------

if __name__ == "__main__":
    bpio.init()
    lg.set_debug_level(20)
    settings.init()
    tmpfile.init(settings.getTempDir())
    contactsdb.init()
    eccmap.init()
    key.InitMyKey()
    init()
    test()