diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4179c76 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +*.pyc +*~ +sphinx/build +build +dist +src/bitcoin_python.egg-info diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..c28fc44 --- /dev/null +++ b/COPYING @@ -0,0 +1,20 @@ +Copyright (c) 2010-2011 Bitcoin-Python developers +Copyright (c) 2016 VERGE-Python developers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/Changelog b/Changelog new file mode 100644 index 0000000..3758045 --- /dev/null +++ b/Changelog @@ -0,0 +1,400 @@ +2014-03-02 17:55:05 -0600 Naveen Garg + + * add importprivkey method + +2014-02-26 15:34:39 -0800 Peter Harrington + + * Update config.py + +2014-01-28 19:58:26 +0100 Jean-Christophe Saad-Dupuy + + * updated changelog + +2014-01-28 19:26:06 +0100 Jean-Christophe Saad-Dupuy + + * Version bump (tag: v0.1.2) + +2014-01-28 11:31:13 -0600 benfbat + + * Update config.py + +2014-01-27 23:08:33 +0100 Jean-Christophe Saad-Dupuy + + * Added support for loading verge.conf under windows + +2014-01-26 23:00:57 +0100 jcsaaddupuy + + * Update README.rst + +2014-01-26 23:06:44 +0100 Jean-Christophe Saad-Dupuy + + * markdown + +2014-01-26 23:05:31 +0100 Jean-Christophe Saad-Dupuy + + * updated verge-qt connection instructions + +2014-01-22 02:26:02 +0100 Jean-Christophe Saad-Dupuy + + * fixed markdown + +2014-01-22 02:24:44 +0100 Jean-Christophe Saad-Dupuy + + * Added instruction for connection with verge-t + +2014-01-21 18:51:36 +0100 Jean-Christophe Saad-Dupuy + + * Updated documentation link + +2014-01-21 18:41:36 +0100 Jean-Christophe Saad-Dupuy + + * Updated changelog (tag: v0.1.1) + +2014-01-21 18:41:09 +0100 Jean-Christophe Saad-Dupuy + + * updated version in documentation + +2014-01-21 09:55:38 +0100 jcsaaddupuy + + * Update README.rst + +2014-01-20 21:17:42 +0100 Jean-Christophe Saad-Dupuy + + * Removed pip instructions + +2014-01-20 20:52:44 +0100 Jean-Christophe Saad-Dupuy + + * bump version + +2014-01-20 20:52:18 +0100 Jean-Christophe Saad-Dupuy + + * Removed uggly print + +2014-01-20 20:43:03 +0100 jcsaaddupuy + + * Update README.rst + +2014-01-20 20:35:00 +0100 Jean-Christophe Saad-Dupuy + + * Updated tests + +2014-01-20 20:31:26 +0100 Jean-Christophe Saad-Dupuy + + * Fixed markdown typo + +2014-01-20 20:27:42 +0100 Jean-Christophe Saad-Dupuy + + * version reset (dogedev) + +2014-01-20 20:26:08 +0100 Jean-Christophe Saad-Dupuy + + * Updated documentation + +2014-01-20 19:58:38 +0100 Jean-Christophe Saad-Dupuy + + * changed default rpc port + +2014-01-20 19:41:43 +0100 Jean-Christophe Saad-Dupuy + + * Migration bitcoin -> verge + +2014-01-20 19:12:31 +0100 Jean-Christophe Saad-Dupuy + + * Changed bitcoin -> verge + +2013-12-26 10:33:05 +0100 Wladimir J. van der Laan + + * fix documentation for sendtoaddress + +2013-12-01 01:05:30 -0500 jon + + * Changed iterkeys() to keys() to make the code python3 compatible. The method keys() exists in both python 2 and 3 but keysiter() does not exist in python 3 since keys() by defaults returns an iterator. + +2013-10-29 12:02:27 -0200 Leandro Boscariol + + * Made sure the code will raise InsufficientFunds or stop + +2013-10-29 11:14:15 -0200 Leandro Boscariol + + * Work around to raise InsufficientFunds exception when needed + +2013-09-27 15:49:55 +0200 Nicolas Kuttler + + * Add signmessage and verifymessage support + +2013-09-27 14:29:31 +0200 Nicolas Kuttler + + * Add --noremote option + +2013-09-27 13:08:17 +0200 Nicolas Kuttler + + * Make the test runs configurable + +2013-09-11 18:16:59 +0200 mUniKeS + + * Add gettxout function + +2013-09-02 19:46:04 +0200 Wladimir J. van der Laan + + * connect_to_local: check cfg for None + +2013-05-30 17:59:03 +0200 Oliver Gasser + + * Add dumpprivkey() function. + +2013-05-30 16:48:03 +0200 Oliver Gasser + + * Use items() instead of iteritems(). + +2013-04-25 08:27:27 +0300 Aviad Reich + + * pep8 styling conventions + +2013-04-24 22:39:24 -0600 Jeff Cook + + * Raise a TransportException on HTTP 403. + +2013-04-24 22:39:06 -0600 Jeff Cook + + * Define TransportException exception class. + +2013-04-22 14:05:03 +0400 Nikolay Belikov + + * + Added exception wrapper into AuthServiceProxy + +2013-04-21 08:56:40 -0600 Jeff Cook + + * Inform user when 403 Forbidden is sent by bitcoind. + +2013-04-21 13:07:59 +0300 Aviad Reich + + * add tests for connect_to_remote. SSL is Faulty + +2013-04-17 12:49:35 +0400 Nikolay Belikov + + * ! Minor code style fixes + +2013-04-16 18:46:46 +0400 Nikolay Belikov + + * Major overhaul of AuthServiceProxy + +2013-04-14 21:35:38 -0500 Jason Kölker + + * Allow getbalance default account with minconf=0 + +2013-03-30 16:32:59 +0100 Wladimir J. van der Laan + + * bump version number to 0.3 (tag: v0.3) + +2013-03-30 16:13:06 +0100 Aviad Reich + + * add keypoolrefill method + +2013-03-20 00:33:59 +0200 Aviad Reich + + * raw transaction support added + +2013-03-21 14:41:33 +0200 Aviad Reich + + * cherry pick to fix dont_raise so it only blocks the correct exceptions to return a boolean (origin/wallet_locking) + +2013-03-29 10:15:09 +0300 Aviad Reich + + * ignore dist and python_egg + +2013-03-23 19:08:46 +0000 Aviad Reich + + * deprecated getblocknumber - use getblockcount instead + +2013-03-19 23:01:18 +0200 Aviad Reich + + * add wallet locking/unlocking support + +2013-03-19 14:42:26 +0200 Aviad Reich + + * in listtransactions, iterate all accounts if account is None (origin/listtransactions) + +2013-03-19 11:16:38 +0200 Aviad Reich + + * listaccounts can return a dictionary from account names to their balance if the param as_dict is True, update tests. (origin/listaccounts) + +2013-03-19 09:44:20 +0200 Aviad Reich + + * add tests for listunspent and getmininginfo + +2013-03-18 08:18:23 +0200 Aviad Reich + + * refactor __repr__ + +2013-03-17 09:43:44 +0200 Aviad Reich + + * flake8 style conventions fixes + +2013-03-18 00:13:42 +0200 Aviad Reich + + * add listunspent method + +2013-03-17 23:46:44 +0200 Aviad Reich + + * add support for getmininginfo + +2013-03-17 16:37:09 +0200 Aviad Reich + + * Issue #15: add from parameter to listtransactions + +2013-03-15 22:14:10 +0100 David Barton + + * Fixed usage.rst broken links + +2013-03-14 09:26:23 +0200 Aviad Reich + + * connect_to_local(): use default testnet port, when the config file has testnet=x + +2013-02-10 17:35:14 +0100 Adrian + + * Add getrawtransaction method + +2013-01-16 03:28:11 +0100 Thomas Steen Rasmussen + + * fix bug when rpc reply error is null in json + +2012-12-12 00:14:34 +0100 Benoît HERVIER + + * There isn't always an error key in resp dict + +2012-12-12 00:12:40 +0100 Benoît HERVIER + + * There isn't always an error key in resp dict + +2012-12-12 00:10:41 +0100 Benoît HERVIER + + * Allow use of https + +2012-12-12 00:09:38 +0100 Benoît HERVIER + + * Allow use of https + +2012-10-29 16:46:18 +0100 Harald Schilly + + * assert that we are really in the testnet + +2012-10-28 23:25:25 +0100 Harald Schilly + + * optionally allow to pass in the path to the bitcoin.conf file if it is at a non-standard path + +2012-10-28 21:52:48 +0100 Harald Schilly + + * fixing tests + +2012-10-23 02:57:40 +0200 Thomas Steen Rasmussen + + * Add support for the 'verifymessage' RPC command + +2012-10-05 18:45:50 +0200 Wladimir J. van der Laan + + * Switch to jgarzik's jsonrpc implementation + +2012-10-05 18:32:23 +0200 Wladimir J. van der Laan + + * Use RPC error codes from bitcoin core source + +2012-07-15 12:07:53 +0400 Alexander Petrovich + + * Added listsinceblock, getblock, getblockhash + +2011-09-04 15:17:44 +0200 Jure Vrscaj + + * Added sendmany command. + +2011-08-24 17:28:14 +0000 toomanysecrets0 + + * Edited README.rst via GitHub + +2011-08-24 16:57:01 +0000 toomanysecrets0 + + * under new management + +2011-08-24 14:56:22 +0200 Wladimir J. van der Laan + + * update changelog + +2011-08-24 14:53:53 +0200 Wladimir J. van der Laan + + * allow listtransactions() (default to '' account), add test for gettransaction + +2011-08-24 11:20:43 +0200 Wladimir J. van der Laan + + * add license (MIT) (tag: v0.2) + +2011-08-24 23:00:01 +0300 Wladimir J. van der Laan + + * mention cheeseshop page + +2011-08-24 10:16:46 +0200 Wladimir J. van der Laan + + * link to new doc + +2011-08-24 10:09:12 +0200 Wladimir J. van der Laan + + * rename package to 'bitcoinrpc' + +2011-08-24 09:42:34 +0200 Wladimir J. van der Laan + + * add neccesary metadata + +2011-08-24 09:22:43 +0200 Witchspace + + * Version bump + +2011-08-20 09:00:18 +0400 Alexander Petrovich + + * Edited src/bitcoin/connection.py via GitHub + +2011-07-04 13:52:17 +0100 Greg Hughes + + * Look in correct location for bitcoin.conf on Mac OS X + +2011-06-06 15:48:41 +0200 Daniel Poelzleithner + + * add minconf to getbalance + +2011-06-06 15:47:39 +0200 Daniel Poelzleithner + + * add listtransactions address filter + +2011-06-06 15:46:30 +0200 Daniel Poelzleithner + + * fix bug in listreceivedbyaddress + +2011-05-18 21:10:47 +0200 Witchspace + + * add TODOs + +2011-05-18 21:10:11 +0200 Witchspace + + * add TODOs + +2011-05-18 20:54:47 +0200 Witchspace + + * default rpcuser to '' + +2011-05-16 17:43:04 -0300 Carlos da Costa + + * Ignore comments in the read_config_file. Ignore lines without '='. + +2011-03-29 15:06:10 +0200 Jure Vrscaj + + * Added "listaccounts" command. + +2010-12-20 18:29:30 -0800 Stephen + + * Add import BitcoinConnection to connect_to_remote() + +2010-12-20 18:29:30 -0800 Stephen + + * Add import BitcoinConnection to connect_to_remote() + +2010-12-11 20:13:00 +0100 Witchspace + + * initial commit (tag: v0.1.0) + diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..14f1e06 --- /dev/null +++ b/README.rst @@ -0,0 +1,52 @@ +``` +____ _________________________ ________ ___________ +\ \ / /\_ _____/\______ \ / _____/ \_ _____/ + \ Y / | __)_ | _// \ ___ | __)_ + \ / | \ | | \\ \_\ \ | \ 2016 VERGE + \___/ /_______ / |____|_ / \______ //_______ / + \/ \/ \/ \/ +``` +# A Python library for the VERGE Client +It is a set of Python libraries that allows easy access to the +VERGE peer-to-peer cryptocurrency client API. + + +Installation instructions +=========================== + +verge-python uses setuptools for the install script. There are no dependencies apart from Python itself. + +:: + + $ python setup.py build + $ python setup.py install + + +Pypi / Cheeseshop +================== + +It is possible to install the package through Pypi (cheeseshop), see http://pypi.python.org/pypi?:action=display&name=verge-python +:: + $ pip install verge-python + # if not working, try + $ pip install --pre verge-python + +Connection to verge-qt +========================= + +If you want to connect to verge-qt, add server=1 in your VERGE.conf +:: + + rpcuser=vergerpcuser + rpcpassword=A RANDOM GENERATED PASSWORD + server=1 + +TODO +====== +These things still have to be added: + +- SSL support (including certificate verification) for managing remote verge daemons. + +verge-python is a fork of bitcoin-python : https://github.com/laanwj/bitcoin-python + + diff --git a/dist-tools/changelog.sh b/dist-tools/changelog.sh new file mode 100644 index 0000000..d977e15 --- /dev/null +++ b/dist-tools/changelog.sh @@ -0,0 +1,2 @@ +#!/bin/bash +git --no-pager log --no-merges --format="%ai %aN %n%n%x09* %s%d%n" diff --git a/doc/_sources/apireference.txt b/doc/_sources/apireference.txt new file mode 100644 index 0000000..795a567 --- /dev/null +++ b/doc/_sources/apireference.txt @@ -0,0 +1,13 @@ +================= + API reference +================= + +.. toctree:: + :maxdepth: 2 + + vergerpc.rst + vergerpc.connection.rst + vergerpc.exceptions.rst + vergerpc.data.rst + vergerpc.config.rst + diff --git a/doc/_sources/examples.txt b/doc/_sources/examples.txt new file mode 100644 index 0000000..3057b01 --- /dev/null +++ b/doc/_sources/examples.txt @@ -0,0 +1,43 @@ +**************************** + Examples +**************************** + +A basic program that uses ``python-verge`` looks like this: + +First, import the library and exceptions. + +:: + + import vergerpc + from vergerpc.exceptions import InsufficientFunds + +Then, we connect to the currently running ``verge`` instance of the current user on the local machine +with one call to +:func:`~vergerpc.connect_to_local`. This returns a :class:`~vergerpc.connection.VERGEConnection` objects: + +:: + + conn = vergerpc.connect_to_local() + +Try to move one verge from account ``testaccount`` to account ``testaccount2`` using +:func:`~vergerpc.connection.VERGEConnection.move`. Catch the :class:`~vergerpc.exceptions.InsufficientFunds` +exception in the case the originating account is broke: + +:: + + try: + conn.move("testaccount", "testaccount2", 1.0) + except InsufficientFunds,e: + print "Account does not have enough funds available!" + + +Retrieve general server information with :func:`~vergerpc.connection.VERGEConnection.getinfo` and print some statistics: + +:: + + info = conn.getinfo() + print "Blocks: %i" % info.blocks + print "Connections: %i" % info.connections + print "Difficulty: %f" % info.difficulty + + diff --git a/doc/_sources/gettingstarted.txt b/doc/_sources/gettingstarted.txt new file mode 100644 index 0000000..4b34042 --- /dev/null +++ b/doc/_sources/gettingstarted.txt @@ -0,0 +1,11 @@ +================= + Getting Started +================= + +.. toctree:: + :maxdepth: 2 + + introduction.rst + usage.rst + examples.rst + diff --git a/doc/_sources/index.txt b/doc/_sources/index.txt new file mode 100644 index 0000000..92eeeb0 --- /dev/null +++ b/doc/_sources/index.txt @@ -0,0 +1,24 @@ +================================================== + verge-python - Easy-to-use VERGE API client. +================================================== + +``verge-python`` is a set of Python libraries that allows easy access to the +verge_ peer-to-peer cryptocurrency client API. + +Contents: + +.. toctree:: + :maxdepth: 2 + + gettingstarted.rst + apireference.rst + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + +.. _verge: http://vergecurrency.com/ + diff --git a/doc/_sources/introduction.txt b/doc/_sources/introduction.txt new file mode 100644 index 0000000..6990749 --- /dev/null +++ b/doc/_sources/introduction.txt @@ -0,0 +1,47 @@ +**************************** + Introduction +**************************** + +The goal of this library is to make it easier for: + +- Payment gateways to support VERGE +- Merchant sites to integrate VERGE payments directly +- Other services that require (micro-)payments to use VERGE + +In this initial release it implements a thin wrapper around the +VERGE JSON-RPC API. Using this API from Python directly is conceptually very simple, +here is the example from the API +documentation page: + +:: + + from jsonrpc import ServiceProxy + + access = ServiceProxy("http://user:password@127.0.0.1:20102") + access.getinfo() + access.listreceivedbyaddress(6) + access.sendtoaddress("D1yEmxiMso2RsFVfBcCa616npBvGgxiBX", 1000) + +However, this approach has some disadvantages, one thing is that error handling is complex, as it +requires manually checking the contents of :const:`JSONException` objects. + +``verge-python`` attempts to create an even more friendly interface by wrapping the JSON-RPC API. The major advantages +compared to a raw ``jsonrpc`` based approach are: + +- Better exception handling. Exceptions are converted to subclasses of :class:`~vergerpc.exceptions.VERGEException`. + +- Automatic verge configuration loading. In case the ``verge -server`` or ``verged`` program runs on the same + machine as the client script, and as the same user, the configuration file can automatically be parsed. This + makes it unneccesary to explicitly specify a *username* and *password*. Of course, this is still possible. + +- Documentation in Pythonish format. You are reading this right now. + +- The functions + :func:`~vergerpc.connection.VERGEConnection.getinfo`, :func:`~vergerpc.connection.VERGEConnection.listreceivedbyaccount`, + :func:`~vergerpc.connection.VERGEConnection.listreceivedbyaddress`, + :func:`~vergerpc.connection.VERGEConnection.listtransactions` and more return actual Python objects, instead of simply + dictionaries. This makes for cleaner code, as the fields can simply be addressed with ``x.foo`` instead of + ``x['foo']``. + +The plan for future releases is to add a more high-level interface on top of this. + diff --git a/doc/_sources/usage.txt b/doc/_sources/usage.txt new file mode 100644 index 0000000..5fd934d --- /dev/null +++ b/doc/_sources/usage.txt @@ -0,0 +1,120 @@ +================= + Usage +================= + +See also the `main verge documentation`_ for details and background on setting up and +using verged remotely. + +Setting up verge for remote control +------------------------------------- + +If you run VERGE with the ``-server`` argument, or if you run ``verged``, it can be controlled +either by sending it HTTP-JSON-RPC commands. + +However, beginning with VERGE 0.3.3 you must create a ``verge.conf`` file in the VERGE data directory +(default ``$HOME/.dogeconf``) and set an RPC password: + +:: + + rpcuser=anything + rpcpassword=anything + +Once that is done, the easiest way to check whether VERGE accepts remote commands is by running +VERGE again, with the command (and any parameters) as arguments. For example: + +:: + + $ verged getinfo + +Connecting to the wallet from Python +------------------------------------- + +There are two functions for this: + +*Connecting to local verge instance* + Use the function :func:`~vergerpc.connect_to_local`. This automagically + sorts out the connection to a verge process running on the current machine, + for the current user. + + :: + + conn = vergerpc.connect_to_local() + +*Connecting to a remote verge instance* + Use the function :func:`~vergerpc.connect_to_remote`. For this function + it is neccesary to explicitly specify a hostname and port to connect to, and + to provide user credentials for logging in. + + :: + + conn = vergerpc.connect_to_remote('foo', 'bar', host='payments.yoyodyne.com', port=20102) + + +How to use the API +------------------------------------- + +For basic sending and receiving of payments, the four most important methods are + +*Getting the current balance* + Use the method :func:`~vergerpc.connection.VERGEConnection.getbalance` to get the current server balance. + + :: + + print "Your balance is %f" % (conn.getbalance(),) + +*Check a customer address for validity and get information about it* + This can be done with the method :func:`~vergerpc.connection.VERGEConnection.validateaddress`. + + :: + + rv = conn.validateaddress(foo) + if rv.isvalid: + print "The address that you provided is valid" + else: + print "The address that you provided is invalid, please correct" + +*Sending payments* + The method :func:`~vergerpc.connection.VERGEConnection.sendtoaddress` sends a specified + amount of coins to a specified address. + + :: + + conn.sendtoaddress("DsTGAm1ApjEJfsWfAaRVaZHRm26mv5GL73", 20000.0) + +*Get a new address for accepting payments* + To accept payments, use the method :func:`~vergerpc.connection.VERGEConnection.getnewaddress` + to generate a new address. Give this address to the customer and store it in a safe place, to be able to check + when the payment to this address has been made. + + :: + + pay_to = conn.getnewaddress() + print "We will ship the pirate sandwidth after payment of 20000 coins to ", pay_to + +*Check how much has been received at a certain address* + The method :func:`~vergerpc.connection.VERGEConnection.getreceivedbyaddress` + returns how many verges have been received at a certain address. Together with the + previous function, this can be used to check whether a payment has been made + by the customer. + + :: + + amount = conn.getreceivedbyaddress(pay_to) + if amount > 20000.0: + print "Thanks, your sandwidth will be prepared and shipped." + + + + +The account API +------------------------------------- +More advanced usage of verge allows multiple accounts within one wallet. This +can be useful if you are writing software for a bank, or +simply want to have a clear separation between customers payments. + +For this, see the `Account API`_ documentation. + +.. _main bitcoin documentation: https://en.bitcoin.it/wiki/Main_Page +.. _account API: https://en.bitcoin.it/wiki/Accounts_explained + + diff --git a/doc/_sources/vergerpc.config.txt b/doc/_sources/vergerpc.config.txt new file mode 100644 index 0000000..50afc27 --- /dev/null +++ b/doc/_sources/vergerpc.config.txt @@ -0,0 +1,7 @@ +:mod:`vergerpc.config` --- Utilities for reading verge configuration files +==================================================================================== + +.. automodule:: vergerpc.config + :members: + :show-inheritance: + diff --git a/doc/_sources/vergerpc.connection.txt b/doc/_sources/vergerpc.connection.txt new file mode 100644 index 0000000..922fc9f --- /dev/null +++ b/doc/_sources/vergerpc.connection.txt @@ -0,0 +1,8 @@ +:mod:`vergerpc.connection` --- Connect to VERGE server via JSON-RPC +==================================================================================== + +.. automodule:: vergerpc.connection + :members: + :show-inheritance: + + diff --git a/doc/_sources/vergerpc.data.txt b/doc/_sources/vergerpc.data.txt new file mode 100644 index 0000000..fe3a16b --- /dev/null +++ b/doc/_sources/vergerpc.data.txt @@ -0,0 +1,7 @@ +:mod:`vergerpc.data` --- VERGE RPC service, data objects +==================================================================================== + +.. automodule:: vergerpc.data + :members: + :show-inheritance: + diff --git a/doc/_sources/vergerpc.exceptions.txt b/doc/_sources/vergerpc.exceptions.txt new file mode 100644 index 0000000..ae74eb7 --- /dev/null +++ b/doc/_sources/vergerpc.exceptions.txt @@ -0,0 +1,7 @@ +:mod:`vergerpc.exceptions` --- Exception definitions +==================================================================================== + +.. automodule:: vergerpc.exceptions + :members: + :show-inheritance: + diff --git a/doc/_sources/vergerpc.txt b/doc/_sources/vergerpc.txt new file mode 100644 index 0000000..e931a6b --- /dev/null +++ b/doc/_sources/vergerpc.txt @@ -0,0 +1,7 @@ +:mod:`vergerpc` --- Convenience functions +==================================================================================== + +.. automodule:: vergerpc + :members: + :show-inheritance: + diff --git a/doc/_sources/vergerpc.util.txt b/doc/_sources/vergerpc.util.txt new file mode 100644 index 0000000..81bb6db --- /dev/null +++ b/doc/_sources/vergerpc.util.txt @@ -0,0 +1,7 @@ +:mod:`vergerpc.util` --- Generic utilities used by verge client library +==================================================================================== + +.. automodule:: vergerpc.util + :members: + :show-inheritance: + diff --git a/doc/_static/ajax-loader.gif b/doc/_static/ajax-loader.gif new file mode 100644 index 0000000..61faf8c Binary files /dev/null and b/doc/_static/ajax-loader.gif differ diff --git a/doc/_static/basic.css b/doc/_static/basic.css new file mode 100644 index 0000000..c959cf0 --- /dev/null +++ b/doc/_static/basic.css @@ -0,0 +1,537 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox input[type="text"] { + width: 170px; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + width: 30px; +} + +img { + border: 0; + max-width: 100%; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li div.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable dl, table.indextable dd { + margin-top: 0; + margin-bottom: 0; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- general body styles --------------------------------------------------- */ + +a.headerlink { + visibility: hidden; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.field-list ul { + padding-left: 1em; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px 7px 0 7px; + background-color: #ffe; + width: 40%; + float: right; +} + +p.sidebar-title { + font-weight: bold; +} + +/* -- topics ---------------------------------------------------------------- */ + +div.topic { + border: 1px solid #ccc; + padding: 7px 7px 0 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +div.admonition dl { + margin-bottom: 0; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + border: 0; + border-collapse: collapse; +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +table.field-list td, table.field-list th { + border: 0 !important; +} + +table.footnote td, table.footnote th { + border: 0 !important; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +dl { + margin-bottom: 15px; +} + +dd p { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +dt:target, .highlighted { + background-color: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.optional { + font-size: 1.3em; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +td.linenos pre { + padding: 5px 0px; + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + margin-left: 0.5em; +} + +table.highlighttable td { + padding: 0 0.5em 0 0.5em; +} + +tt.descname { + background-color: transparent; + font-weight: bold; + font-size: 1.2em; +} + +tt.descclassname { + background-color: transparent; +} + +tt.xref, a tt { + background-color: transparent; + font-weight: bold; +} + +h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} \ No newline at end of file diff --git a/doc/_static/comment-bright.png b/doc/_static/comment-bright.png new file mode 100644 index 0000000..551517b Binary files /dev/null and b/doc/_static/comment-bright.png differ diff --git a/doc/_static/comment-close.png b/doc/_static/comment-close.png new file mode 100644 index 0000000..09b54be Binary files /dev/null and b/doc/_static/comment-close.png differ diff --git a/doc/_static/comment.png b/doc/_static/comment.png new file mode 100644 index 0000000..92feb52 Binary files /dev/null and b/doc/_static/comment.png differ diff --git a/doc/_static/default.css b/doc/_static/default.css new file mode 100644 index 0000000..e534a07 --- /dev/null +++ b/doc/_static/default.css @@ -0,0 +1,256 @@ +/* + * default.css_t + * ~~~~~~~~~~~~~ + * + * Sphinx stylesheet -- default theme. + * + * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +body { + font-family: sans-serif; + font-size: 100%; + background-color: #11303d; + color: #000; + margin: 0; + padding: 0; +} + +div.document { + background-color: #1c4e63; +} + +div.documentwrapper { + float: left; + width: 100%; +} + +div.bodywrapper { + margin: 0 0 0 230px; +} + +div.body { + background-color: #ffffff; + color: #000000; + padding: 0 20px 30px 20px; +} + +div.footer { + color: #ffffff; + width: 100%; + padding: 9px 0 9px 0; + text-align: center; + font-size: 75%; +} + +div.footer a { + color: #ffffff; + text-decoration: underline; +} + +div.related { + background-color: #133f52; + line-height: 30px; + color: #ffffff; +} + +div.related a { + color: #ffffff; +} + +div.sphinxsidebar { +} + +div.sphinxsidebar h3 { + font-family: 'Trebuchet MS', sans-serif; + color: #ffffff; + font-size: 1.4em; + font-weight: normal; + margin: 0; + padding: 0; +} + +div.sphinxsidebar h3 a { + color: #ffffff; +} + +div.sphinxsidebar h4 { + font-family: 'Trebuchet MS', sans-serif; + color: #ffffff; + font-size: 1.3em; + font-weight: normal; + margin: 5px 0 0 0; + padding: 0; +} + +div.sphinxsidebar p { + color: #ffffff; +} + +div.sphinxsidebar p.topless { + margin: 5px 10px 10px 10px; +} + +div.sphinxsidebar ul { + margin: 10px; + padding: 0; + color: #ffffff; +} + +div.sphinxsidebar a { + color: #98dbcc; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + + + +/* -- hyperlink styles ------------------------------------------------------ */ + +a { + color: #355f7c; + text-decoration: none; +} + +a:visited { + color: #355f7c; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + + + +/* -- body styles ----------------------------------------------------------- */ + +div.body h1, +div.body h2, +div.body h3, +div.body h4, +div.body h5, +div.body h6 { + font-family: 'Trebuchet MS', sans-serif; + background-color: #f2f2f2; + font-weight: normal; + color: #20435c; + border-bottom: 1px solid #ccc; + margin: 20px -20px 10px -20px; + padding: 3px 0 3px 10px; +} + +div.body h1 { margin-top: 0; font-size: 200%; } +div.body h2 { font-size: 160%; } +div.body h3 { font-size: 140%; } +div.body h4 { font-size: 120%; } +div.body h5 { font-size: 110%; } +div.body h6 { font-size: 100%; } + +a.headerlink { + color: #c60f0f; + font-size: 0.8em; + padding: 0 4px 0 4px; + text-decoration: none; +} + +a.headerlink:hover { + background-color: #c60f0f; + color: white; +} + +div.body p, div.body dd, div.body li { + text-align: justify; + line-height: 130%; +} + +div.admonition p.admonition-title + p { + display: inline; +} + +div.admonition p { + margin-bottom: 5px; +} + +div.admonition pre { + margin-bottom: 5px; +} + +div.admonition ul, div.admonition ol { + margin-bottom: 5px; +} + +div.note { + background-color: #eee; + border: 1px solid #ccc; +} + +div.seealso { + background-color: #ffc; + border: 1px solid #ff6; +} + +div.topic { + background-color: #eee; +} + +div.warning { + background-color: #ffe4e4; + border: 1px solid #f66; +} + +p.admonition-title { + display: inline; +} + +p.admonition-title:after { + content: ":"; +} + +pre { + padding: 5px; + background-color: #eeffcc; + color: #333333; + line-height: 120%; + border: 1px solid #ac9; + border-left: none; + border-right: none; +} + +tt { + background-color: #ecf0f3; + padding: 0 1px 0 1px; + font-size: 0.95em; +} + +th { + background-color: #ede; +} + +.warning tt { + background: #efc2c2; +} + +.note tt { + background: #d6d6d6; +} + +.viewcode-back { + font-family: sans-serif; +} + +div.viewcode-block:target { + background-color: #f4debf; + border-top: 1px solid #ac9; + border-bottom: 1px solid #ac9; +} \ No newline at end of file diff --git a/doc/_static/doctools.js b/doc/_static/doctools.js new file mode 100644 index 0000000..2036e5f --- /dev/null +++ b/doc/_static/doctools.js @@ -0,0 +1,238 @@ +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Sphinx JavaScript utilities for all documentation. + * + * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/** + * select a different prefix for underscore + */ +$u = _.noConflict(); + +/** + * make the code below compatible with browsers without + * an installed firebug like debugger +if (!window.console || !console.firebug) { + var names = ["log", "debug", "info", "warn", "error", "assert", "dir", + "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", + "profile", "profileEnd"]; + window.console = {}; + for (var i = 0; i < names.length; ++i) + window.console[names[i]] = function() {}; +} + */ + +/** + * small helper function to urldecode strings + */ +jQuery.urldecode = function(x) { + return decodeURIComponent(x).replace(/\+/g, ' '); +}; + +/** + * small helper function to urlencode strings + */ +jQuery.urlencode = encodeURIComponent; + +/** + * This function returns the parsed url parameters of the + * current request. Multiple values per key are supported, + * it will always return arrays of strings for the value parts. + */ +jQuery.getQueryParameters = function(s) { + if (typeof s == 'undefined') + s = document.location.search; + var parts = s.substr(s.indexOf('?') + 1).split('&'); + var result = {}; + for (var i = 0; i < parts.length; i++) { + var tmp = parts[i].split('=', 2); + var key = jQuery.urldecode(tmp[0]); + var value = jQuery.urldecode(tmp[1]); + if (key in result) + result[key].push(value); + else + result[key] = [value]; + } + return result; +}; + +/** + * highlight a given string on a jquery object by wrapping it in + * span elements with the given class name. + */ +jQuery.fn.highlightText = function(text, className) { + function highlight(node) { + if (node.nodeType == 3) { + var val = node.nodeValue; + var pos = val.toLowerCase().indexOf(text); + if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { + var span = document.createElement("span"); + span.className = className; + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + node.parentNode.insertBefore(span, node.parentNode.insertBefore( + document.createTextNode(val.substr(pos + text.length)), + node.nextSibling)); + node.nodeValue = val.substr(0, pos); + } + } + else if (!jQuery(node).is("button, select, textarea")) { + jQuery.each(node.childNodes, function() { + highlight(this); + }); + } + } + return this.each(function() { + highlight(this); + }); +}; + +/** + * Small JavaScript module for the documentation. + */ +var Documentation = { + + init : function() { + this.fixFirefoxAnchorBug(); + this.highlightSearchWords(); + this.initIndexTable(); + }, + + /** + * i18n support + */ + TRANSLATIONS : {}, + PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, + LOCALE : 'unknown', + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext : function(string) { + var translated = Documentation.TRANSLATIONS[string]; + if (typeof translated == 'undefined') + return string; + return (typeof translated == 'string') ? translated : translated[0]; + }, + + ngettext : function(singular, plural, n) { + var translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated == 'undefined') + return (n == 1) ? singular : plural; + return translated[Documentation.PLURALEXPR(n)]; + }, + + addTranslations : function(catalog) { + for (var key in catalog.messages) + this.TRANSLATIONS[key] = catalog.messages[key]; + this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); + this.LOCALE = catalog.locale; + }, + + /** + * add context elements like header anchor links + */ + addContextElements : function() { + $('div[id] > :header:first').each(function() { + $('\u00B6'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this headline')). + appendTo(this); + }); + $('dt[id]').each(function() { + $('\u00B6'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this definition')). + appendTo(this); + }); + }, + + /** + * workaround a firefox stupidity + */ + fixFirefoxAnchorBug : function() { + if (document.location.hash && $.browser.mozilla) + window.setTimeout(function() { + document.location.href += ''; + }, 10); + }, + + /** + * highlight the search words provided in the url in the text + */ + highlightSearchWords : function() { + var params = $.getQueryParameters(); + var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; + if (terms.length) { + var body = $('div.body'); + if (!body.length) { + body = $('body'); + } + window.setTimeout(function() { + $.each(terms, function() { + body.highlightText(this.toLowerCase(), 'highlighted'); + }); + }, 10); + $('
' + _('Hide Search Matches') + '
') + .appendTo($('#searchbox')); + } + }, + + /** + * init the domain index toggle buttons + */ + initIndexTable : function() { + var togglers = $('img.toggler').click(function() { + var src = $(this).attr('src'); + var idnum = $(this).attr('id').substr(7); + $('tr.cg-' + idnum).toggle(); + if (src.substr(-9) == 'minus.png') + $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); + else + $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); + }).css('display', ''); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { + togglers.click(); + } + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords : function() { + $('#searchbox .highlight-link').fadeOut(300); + $('span.highlighted').removeClass('highlighted'); + }, + + /** + * make the url absolute + */ + makeURL : function(relativeURL) { + return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; + }, + + /** + * get the current relative url + */ + getCurrentURL : function() { + var path = document.location.pathname; + var parts = path.split(/\//); + $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { + if (this == '..') + parts.pop(); + }); + var url = parts.join('/'); + return path.substring(url.lastIndexOf('/') + 1, path.length - 1); + } +}; + +// quick alias for translations +_ = Documentation.gettext; + +$(document).ready(function() { + Documentation.init(); +}); diff --git a/doc/_static/down-pressed.png b/doc/_static/down-pressed.png new file mode 100644 index 0000000..6f7ad78 Binary files /dev/null and b/doc/_static/down-pressed.png differ diff --git a/doc/_static/down.png b/doc/_static/down.png new file mode 100644 index 0000000..3003a88 Binary files /dev/null and b/doc/_static/down.png differ diff --git a/doc/_static/file.png b/doc/_static/file.png new file mode 100644 index 0000000..d18082e Binary files /dev/null and b/doc/_static/file.png differ diff --git a/doc/_static/jquery.js b/doc/_static/jquery.js new file mode 100644 index 0000000..3883779 --- /dev/null +++ b/doc/_static/jquery.js @@ -0,0 +1,2 @@ +/*! jQuery v1.8.3 jquery.com | jquery.org/license */ +(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;at |
|
+ + |
+ |
|
+ + |
|
+
|
+
|
+ + |
|
+
|
+ + |
+ | + |
|
+ + |
|
+
|
+
+ | + |
|
+
|
+
+ | + |
+ |
|
+
verge-python is a set of Python libraries that allows easy access to the +verge peer-to-peer cryptocurrency client API.
+Contents:
+The goal of this library is to make it easier for:
+In this initial release it implements a thin wrapper around the +VERGE JSON-RPC API. Using this API from Python directly is conceptually very simple, +here is the example from the API +documentation page:
+from jsonrpc import ServiceProxy
+
+access = ServiceProxy("http://user:password@127.0.0.1:8332")
+access.getinfo()
+access.listreceivedbyaddress(6)
+access.sendtoaddress("11yEmxiMso2RsFVfBcCa616npBvGgxiBX", 10)
+
However, this approach has some disadvantages, one thing is that error handling is complex, as it +requires manually checking the contents of JSONException objects.
+verge-python attempts to create an even more friendly interface by wrapping the JSON-RPC API. The major advantages +compared to a raw jsonrpc based approach are:
+The plan for future releases is to add a more high-level interface on top of this.
++ d | ||
+ | + vergerpc | + |
+ | + vergerpc.config | + |
+ | + vergerpc.connection | + |
+ | + vergerpc.data | + |
+ | + vergerpc.exceptions | + |
+ | + vergerpc.util | + |
+ Please activate JavaScript to enable the search + functionality. +
++ From here you can search these documents. Enter your search + words into the box below and click "search". Note that the search + function will automatically search for all of the words. Pages + containing fewer words won't appear in the result list. +
+ + +See also the `main verge documentation`_ for details and background on setting up and +using verged remotely.
+If you run VERGE with the -server argument, or if you run verged, it can be controlled +either by sending it HTTP-JSON-RPC commands.
+However, beginning with VERGE 0.3.3 you must create a verge.conf file in the VERGE data directory +(default $HOME/.dogeconf) and set an RPC password:
+rpcuser=anything
+rpcpassword=anything
+
Once that is done, the easiest way to check whether VERGE accepts remote commands is by running +VERGE again, with the command (and any parameters) as arguments. For example:
+$ verged getinfo
+
There are two functions for this:
+Use the function connect_to_local(). This automagically +sorts out the connection to a verge process running on the current machine, +for the current user.
+conn = vergerpc.connect_to_local()
+
Use the function connect_to_remote(). For this function +it is neccesary to explicitly specify a hostname and port to connect to, and +to provide user credentials for logging in.
+conn = vergerpc.connect_to_remote('foo', 'bar', host='payments.yoyodyne.com', port=8332)
+
For basic sending and receiving of payments, the four most important methods are
+Use the method getbalance() to get the current server balance.
+print "Your balance is %f" % (conn.getbalance(),)
+
This can be done with the method validateaddress().
+rv = conn.validateaddress(foo)
+if rv.isvalid:
+ print "The address that you provided is valid"
+else:
+ print "The address that you provided is invalid, please correct"
+
The method sendtoaddress() sends a specified +amount of coins to a specified address.
+conn.sendtoaddress("msTGAm1ApjEJfsWfAaRVaZHRm26mv5GL73", 20.0)
+
To accept payments, use the method getnewaddress() +to generate a new address. Give this address to the customer and store it in a safe place, to be able to check +when the payment to this address has been made.
+pay_to = conn.getnewaddress()
+print "We will ship the pirate sandwidth after payment of 200 coins to ", pay_to
+
The method getreceivedbyaddress() +returns how many verges have been received at a certain address. Together with the +previous function, this can be used to check whether a payment has been made +by the customer.
+amount = conn.getreceivedbyaddress(pay_to)
+if amount > 200.0:
+ print "Thanks, your sandwidth will be prepared and shipped."
+
More advanced usage of verge allows multiple accounts within one wallet. This +can be useful if you are writing software for a bank, or +simply want to have a clear separation between customers payments.
+For this, see the Account API documentation.
+Utilities for reading verge configuration files.
+Read a simple '='-delimited config file. +Raises IOError if unable to open file, or ValueError +if an parse error occurs.
+Read verge default configuration from the current user’s home directory.
+Arguments:
+Connect to VERGE server via JSON-RPC.
+Bases: builtins.object
+A VERGEConnection object defines a connection to a verge server. +It is a thin wrapper around a JSON-RPC API connection.
+Arguments to constructor:
+Safely copies wallet.dat to destination, which can be a directory or a path +with filename.
+Arguments: +- destination – directory or path with filename to backup wallet to.
+Creates a raw transaction spending given inputs +(a list of dictionaries, each containing a transaction id and an output number), +sending to given address(es).
+Returns hex-encoded raw transaction.
+Example usage: +>>> conn.createrawtransaction(
++++
+- [{“txid”: “a9d4599e15b53f3eb531608ddb31f48c695c3d0b3538a6bda871e8b34f2f430c”,
+- “vout”: 0}],
+{“DkZBYBiq6DNoQEKakpMJegyDbw2YiNQnHT”:50})
+
Arguments:
+inputs – A list of {“txid”: txid, “vout”: n} dictionaries.
+they are to be paid.
+Produces a human-readable JSON object for a raw transaction.
+Arguments:
+Returns the private key belonging to <address>.
+Arguments:
+Returns the account associated with the given address.
+Arguments:
+Returns the current verge address for receiving payments to an account.
+Arguments:
+Returns the list of addresses for the given account.
+Arguments:
+Get the current balance, either for an account or the total server balance.
+Arguments: +- account – If this parameter is specified, returns the balance in the account. +- minconf – Minimum number of confirmations required for transferred balance.
+Returns information about the given block hash.
+Returns the number of blocks in the longest block chain.
+Returns hash of block in best-block-chain at index.
+Parameters: | index – index ob the block | +
---|
Returns the block number of the latest block in the longest block chain. +Deprecated. Use getblockcount instead.
+Returns the number of connections to other nodes.
+Returns the proof-of-work difficulty as a multiple of the minimum difficulty.
+Returns True or False, depending on whether generation is enabled.
+Returns a recent hashes per second performance measurement while generating.
+Returns an ServerInfo object containing various state info.
+Returns an MiningInfo object containing various +mining state info.
+Returns a new verge address for receiving payments.
+Arguments:
+Get transaction raw info
+Arguments:
+Returns the total amount received by addresses with an account in transactions with +at least a certain number of confirmations.
+Arguments:
+Returns the total amount received by a verge address in transactions with at least a +certain number of confirmations.
+Arguments:
+Get detailed information about transaction
+Arguments:
+Returns details about an unspent transaction output (UTXO)
+Arguments:
+Get work for remote mining, or submit result. +If data is specified, the server tries to solve the block +using the provided data and returns True if it was successful. +If not, the function returns formatted hash data (WorkItem) +to work on.
+Arguments:
+import private key <privkey> to account [acct], optionally rescanning blockchain .
+Arguments:
+Fills the keypool, requires wallet passphrase to be set.
+Returns a list of account names.
+Arguments:
+Returns a list of accounts.
+Each account is represented with a AccountInfo object.
+Arguments:
+Returns a list of addresses.
+Each address is represented with a AddressInfo object.
+Arguments:
+Returns a list of the last transactions for an account.
+Each transaction is represented with a TransactionInfo object.
+Arguments:
+all accounts if None.
+count – Number of transactions to return.
+from_ – Skip the first <from_> transactions.
+address – Receive address to consider
+Returns a list of unspent transaction inputs in the wallet.
+Arguments:
+Move from one account in your wallet to another.
+Arguments:
+Sends amount from account’s balance to vergeaddress. This method will fail +if there is less than amount verges with minconf confirmations in the account’s +balance (unless account is the empty-string-named default account; it +behaves like the sendtoaddress method). Returns transaction ID on success.
+Arguments:
+Sends specified amounts from account’s balance to vergeaddresses. This method will fail +if there is less than total amount verges with minconf confirmations in the account’s +balance (unless account is the empty-string-named default account; Returns transaction ID +on success.
+Arguments:
+Sends amount from the server’s available balance to vergeaddress.
+Arguments:
+Sets the account associated with the given address.
+Arguments:
+Enable or disable generation (mining) of coins.
+Arguments:
+Sign messages, returns the signature
+Parameters: |
|
+
---|---|
Return type: | unicode + |
+
Sign inputs for raw transaction (serialized, hex-encoded).
+Arguments:
+hexstring – A hex string of the transaction to sign.
+{“txid”: txid, “vout”: n, “scriptPubKey”: hex, “redeemScript”: hex}, representing +previous transaction outputs that this transaction depends on but may not yet be +in the block chain.
+keys that, if given, will be the only keys used to sign the transaction.
+Stop verge server.
+Validate a verge address and return information for it.
+The information is represented by a AddressValidation object.
+Arguments: – Address to validate.
+Verify a signed message
+Parameters: |
|
+
---|---|
Return type: | bool + |
+
Removes the wallet encryption key from memory, locking the wallet. +After calling this method, you will need to call walletpassphrase +again before being able to call any methods which require the wallet +to be unlocked.
+Stores the wallet decryption key in memory for <timeout> seconds.
+passphrase – The wallet passphrase.
+(by keeping the passphrase in memory).
+return False.
+Changes the wallet passphrase from <oldpassphrase> to <newpassphrase>.
+Arguments:
+return False.
+VERGE RPC service, data objects.
+Bases: vergerpc.util.DStruct
+Information object returned by listreceivedbyaccount().
+Bases: vergerpc.util.DStruct
+Information object returned by listreceivedbyaddress().
+Bases: vergerpc.util.DStruct
+Information object returned by validateaddress().
+Bases: vergerpc.util.DStruct
+Information object returned by getmininginfo().
+Bases: vergerpc.util.DStruct
+Information object returned by getinfo().
+errors – Number of errors.
+blocks – Number of blocks.
+paytxfee – Amount of transaction fee to pay.
+keypoololdest – Oldest key in keypool.
+genproclimit – Processor limit for generation.
+connections – Number of connections to other clients.
+difficulty – Current generating difficulty.
+testnet – True if connected to testnet, False if on real network.
+version – VERGE client version.
+proxy – Proxy configured in client.
+hashespersec – Number of hashes per second (if generation enabled).
+balance – Total current server balance.
+generate – True if generation enabled, False if not.
+will be/was locked (if wallet encryption is enabled).
+Bases: vergerpc.util.DStruct
+Information object returned by listtransactions().
+Bases: vergerpc.util.DStruct
+Information object returned by getwork().
+Exception definitions.
+Bases: vergerpc.exceptions.VERGEException
+P2P network error. +This exception is never raised but functions as a superclass +for other P2P client exceptions.
+Bases: builtins.Exception
+Base class for exceptions received from VERGE server.
+Bases: vergerpc.exceptions.ClientException
+Client is still downloading blocks.
+Bases: vergerpc.exceptions.WalletError
+Insufficient funds to complete transaction in wallet or account
+Bases: vergerpc.exceptions.WalletError
+Invalid account name
+Bases: vergerpc.exceptions.VERGEException
+Invalid address or key.
+alias of JSONTypeError
+Bases: vergerpc.exceptions.VERGEException
+Invalid parameter provided to RPC call.
+alias of InvalidAddressOrKey
+Bases: vergerpc.exceptions.VERGEException
+Unexpected type was passed as parameter
+Bases: vergerpc.exceptions.WalletError
+Keypool ran out, call keypoolrefill first
+Bases: vergerpc.exceptions.ClientException
+Not connected to any peers.
+Bases: vergerpc.exceptions.VERGEException
+Out of memory during operation.
+Bases: vergerpc.exceptions.VERGEException
+Operation denied in safe mode (run verged with -disablesafemode).
+alias of WalletError
+Bases: builtins.Exception
+Class to define transport-level failures.
+Bases: vergerpc.exceptions.WalletError
+Wallet is already unlocked
+Bases: vergerpc.exceptions.WalletError
+Failed to encrypt the wallet
+Bases: vergerpc.exceptions.VERGEException
+Unspecified problem with wallet (key not found etc.)
+Bases: vergerpc.exceptions.WalletError
+The wallet passphrase entered was incorrect
+Bases: vergerpc.exceptions.WalletError
+Enter the wallet passphrase with walletpassphrase first
+Bases: vergerpc.exceptions.WalletError
+Command given in wrong wallet encryption state (encrypting an encrypted wallet etc.)
+Convert a JSON error object to a more specific VERGE exception.
+verge-python - Easy-to-use VERGE API client
+Connect to default VERGE instance owned by this user, on this machine.
+Returns a VERGEConnection object.
+Arguments:
++++
+- filename: Path to a configuration file in a non-standard location (optional)
+
Connect to remote or alternative local verge client instance.
+Returns a VERGEConnection object.
+Generic utilities used by verge client library.
+Bases: builtins.object
+Simple dynamic structure, like collections.namedtuple but more flexible +(and less memory-efficient)
+