How to use the fcp.DEBUG function in fcp

To help you get started, we’ve selected a few fcp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github freenet / pyFreenet / fcp / sitemgr.py View on Github external
def save(self):
        """
        Saves the node state
        """
        self.log(DETAIL, "save: saving site config to %s" % self.path)
    
        try:
            self.log(DEBUG, "save: waiting for lock")
    
            self.fileLock.acquire()
    
            self.log(DEBUG, "save: got lock")
    
            confDir = os.path.split(self.path)[0]
    
            tmpFile = os.path.join(self.basedir, ".tmp-%s" % self.name)
            f = file(tmpFile, "w")
            self.log(DETAIL, "save: writing to temp file %s" % tmpFile)
    
            pp = pprint.PrettyPrinter(width=72, indent=2, stream=f)
            js = json.JSONEncoder(indent=2)
            
            w = f.write
github freenet / pyFreenet / fcp / sitemgr.py View on Github external
def save(self):
        """
        Saves the node state
        """
        self.log(DETAIL, "save: saving site config to %s" % self.path)
    
        try:
            self.log(DEBUG, "save: waiting for lock")
    
            self.fileLock.acquire()
    
            self.log(DEBUG, "save: got lock")
    
            confDir = os.path.split(self.path)[0]
    
            tmpFile = os.path.join(self.basedir, ".tmp-%s" % self.name)
            f = file(tmpFile, "w")
            self.log(DETAIL, "save: writing to temp file %s" % tmpFile)
    
            pp = pprint.PrettyPrinter(width=72, indent=2, stream=f)
            js = json.JSONEncoder(indent=2)
            
            w = f.write
    
            def writeVars(comment="", tail="", **kw):
                """
                Pretty-print a 'name=value' line, with optional tail string
                """
github freenet / pyFreenet / fcp / sitemgr.py View on Github external
def runTest():
    
    mgr = SiteMgr(verbosity=DEBUG)
    mgr.insert()