pybitmessage.namecoin module

Copyright (C) 2013 by Daniel Kraft <d@domob.eu>

Namecoin queries

exception RPCError(data)[source]

Bases: exceptions.Exception

Error thrown when the RPC call returns an error.

error = None
ensureNamecoinOptions()[source]

Ensure all namecoin options are set, by setting those to default values that aren’t there.

lookupNamecoinFolder()[source]

Look up the namecoin data folder.

Todo

Check whether this works on other platforms as well!

class namecoinConnection(options=None)[source]

Bases: object

This class handles the Namecoin identity integration.

bufsize = 4096
callRPC(method, params)

Helper routine that actually performs an JSON RPC call.

con = None
host = None
nmctype = None
password = None
port = None
query(string)

Query for the bitmessage address corresponding to the given identity string. If it doesn’t contain a slash, id/ is prepended. We return the result as (Error, Address) pair, where the Error is an error message to display or None in case of success.

queryHTTP(data)

Query the server via HTTP.

queryServer(data)

Helper routine sending data to the RPC server and returning the result.

queryid = 1
test()

Test the connection settings. This routine tries to query a “getinfo” command, and builds either an error message or a success message with some info from it.

user = None