FANDOM


What is the Hive? Edit

The hive is the abstraction we use when talking about a collection of issues. It is also the master class that you will want to interface with when you have need of connecting to a particular hive locally or remotely.

Using the Hive Class Edit

>>> from swarmlib import Hive, Log
>>> log = Log()
>>> hive = Hive("project/", log)
>>> hive = Hive("project/", log, force=true)

Here, the URL is RFC-1738 compliant.

>>> hive = Hive("sftp://fred@someplace.com/path/to/hive",
...   log, config="/path/to/config.cfg")

Initializing a new Hive Edit

>>> hive.init_hive()
>>> hive.init_hive()
 some exception
>>> hive.init_hive(True)

Connecting to a Hive Edit

>>> hive.connect()
>>> hive.connected
'True'

Adding Issues Edit

>>> from swarmlib import Issue
>>> reporter = 'Pauline Parker <pparker@example.com>'
>>> summary = 'Divide by zero error in core library'
>>> details = 'When the Core class is initialized with\n' + \
...           '"stock=0", you get the following error\n' + \
...           '\n' + \
...           'ZeroDivisionError: integer division or\n' + \
...           'modulo by zero\n'
>>>
>>> issue = Issue(reporter=reporter, summary=summary,
...               details=details)
>>> issue.issue_id
'b843'
>>> hive.add_issue(issue)
>>> hive.commit()

Adding new nodes to Issues Edit

>>> from swarmlib import Node
>>> poster='Juliet Hulme <aperry@example.com>'
>>> summary = 'Re: %s' % issue.root_nodes[0].summary
>>> details = 'While the uncaught exception may be a problem,\n' + \
...           'the API documentation does specify that "stock"\n' +\
...           'must be >= 1. So is this really a bug?\n'
>>>
>>> new_node = Node(poster=poster, summary=summary,
...                 details=details, parent_node=issue.root_nodes[0],
...                 root_issue=issue)
>>> hive.add_node(new_node)
>>> hive.commit()

Querying the Hive Edit

Changing Taxonomy Terms Edit

Updating the status on Issues Edit

Cloning a Hive Edit

>>> hive_source = Hive(source_uri, log)
>>> hive_dest = Hive(dest_uri, log)

>>> hive_dest.init(force=True)
>>> hive_dest.clone(hive_source)

Branching an Issue Edit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.