How to use the fcp.FCPNodeConnection 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 / fcpsitemgr.py View on Github external
def createNode(self, **kw):
    
        #kw = {}
    
        if fcpHost and not kw.has_key("fcpHost"):
            kw['host'] = fcpHost
        if fcpPort and not kw.has_key("fcpPort"):
            kw['port'] = fcpPort
        if verbosity and not kw.has_key("verbosity"):
            kw['verbosity'] = verbosity
        if logfile and not kw.has_key("logfile"):
            kw['logfile'] = logfile
    
        #print kw
        
        self.node = fcp.FCPNodeConnection(**kw)
github freenet / pyFreenet / fcpxmlrpc.py View on Github external
- fcpPort - port where FCP port is
            - verbosity - verbosity of output messages, 0 (silent) through 6 (noisy),
              default 4. Refer verbosity constants in fcp module
        """
        # create the server
        host = kw.get('host', xmlrpcHost)
        port = kw.get('port', xmlrpcPort)
    
        SimpleXMLRPCServer.__init__(self, (host, port))
    
        # create the fcp node interface
        fcpHost = kw.get('fcpHost', fcp.defaultFCPHost)
        fcpPort = kw.get('fcpPort', fcp.defaultFCPPort)
        verbosity = kw.get('verbosity', fcp.SILENT)
    
        node = self.node = fcp.FCPNodeConnection(host=fcpHost,
                                                 port=fcpPort,
                                                 verbosity=verbosity,
                                                 )
    
        # create the request handler
        hdlr = FreenetXMLRPCRequestHandler(node)
    
        # link in the request handler object
        self.register_instance(hdlr)
        self.register_introspection_functions()