looks, and to start getting a feel for the libbe interface.
See :py:mod:`libbe.command.base` for the definition of the important
-classes :class:`~libbe.command.base.Option`,
-:class:`~libbe.command.base.Argument`,
-:class:`~libbe.command.base.Command`,
-:class:`~libbe.command.base.InputOutput`,
-:class:`~libbe.command.base.StorageCallbacks`, and
-:class:`~libbe.command.base.UserInterface`. You'll be subclassing
-:class:`~libbe.command.base.Command` for your command, but all those
+classes :py:class:`~libbe.command.base.Option`,
+:py:class:`~libbe.command.base.Argument`,
+:py:class:`~libbe.command.base.Command`,
+:py:class:`~libbe.command.base.InputOutput`,
+:py:class:`~libbe.command.base.StorageCallbacks`, and
+:py:class:`~libbe.command.base.UserInterface`. You'll be subclassing
+:py:class:`~libbe.command.base.Command` for your command, but all those
classes will be important.
BE implements a general framework to make it easy to support command
completion for arbitrary plugins. In order to support this system,
-any of your completable :class:`~libbe.command.base.Argument`
+any of your completable :py:class:`~libbe.command.base.Argument`
instances (in your command's ``.options`` or ``.args``) should be
initialized with some valid completion_callback function. Some common
cases are defined in :py:mod:`libbe.command.util`. If you need more
flexibility, see :py:mod:`libbe.command.list`\'s ``--sort`` option for an
-example of extensions via :class:`libbe.command.util.Completer`, or
+example of extensions via :py:class:`libbe.command.util.Completer`, or
write a custom completion function from scratch.
Take a look at :py:mod:`libbe.ui.command_line` for an example.
Basically you'll need to setup a
-:class:`~libbe.command.base.UserInterface` instance for running
+:py:class:`~libbe.command.base.UserInterface` instance for running
commands. More details to come after I write an HTML UI...
# You should have received a copy of the GNU General Public License along with
# Bugs Everywhere. If not, see <http://www.gnu.org/licenses/>.
-"""Define the :class:`Bug` class for representing bugs.
+"""Define the :py:class:`Bug` class for representing bugs.
"""
import copy
class Bug (settings_object.SavedSettingsObject):
"""A bug (or issue) is a place to store attributes and attach
- :class:`~libbe.comment.Comment`\s. In mailing-list terms, a bug is
+ :py:class:`~libbe.comment.Comment`\s. In mailing-list terms, a bug is
analogous to a thread. Bugs are normally stored in
- :class:`~libbe.bugdir.BugDir`\s.
+ :py:class:`~libbe.bugdir.BugDir`\s.
>>> b = Bug()
>>> print b.status
# You should have received a copy of the GNU General Public License along with
# Bugs Everywhere. If not, see <http://www.gnu.org/licenses/>.
-"""Define the :class:`BugDir` class for storing a collection of bugs.
+"""Define the :py:class:`BugDir` class for storing a collection of bugs.
"""
import copy
class BugDir (list, settings_object.SavedSettingsObject):
- """A BugDir is a container for :class:`~libbe.bug.Bug`\s, with some
+ """A BugDir is a container for :py:class:`~libbe.bug.Bug`\s, with some
additional attributes.
Parameters
----------
- storage : :class:`~libbe.storage.base.Storage`
+ storage : :py:class:`~libbe.storage.base.Storage`
Storage instance containing the bug directory. If
`from_storage` is `False`, `storage` may be `None`.
uuid : str, optional
See Also
--------
- :class:`SimpleBugDir` for some bugdir manipulation exampes.
+ :py:class:`SimpleBugDir` for some bugdir manipulation exampes.
"""
settings_properties = []
# You should have received a copy of the GNU General Public License along with
# Bugs Everywhere. If not, see <http://www.gnu.org/licenses/>.
-"""Define the :class:`ServeCommands` serving BE Commands over HTTP.
+"""Define the :py:class:`ServeCommands` serving BE Commands over HTTP.
See Also
--------
This allows you to run local `be` commands interfacing with remote
data, transmitting command requests over the network.
- :class:`~libbe.command.base.Command` wrapper around
- :class:`ServerApp`.
+ :py:class:`~libbe.command.base.Command` wrapper around
+ :py:class:`ServerApp`.
"""
name = 'serve-commands'
# You should have received a copy of the GNU General Public License along with
# Bugs Everywhere. If not, see <http://www.gnu.org/licenses/>.
-"""Define the :class:`Serve` serving BE Storage over HTTP.
+"""Define the :py:class:`Serve` serving BE Storage over HTTP.
See Also
--------
This allows you to run local `be` commands interfacing with remote
data, transmitting file reads/writes/etc. over the network.
- :class:`~libbe.command.base.Command` wrapper around
- :class:`ServerApp`.
+ :py:class:`~libbe.command.base.Command` wrapper around
+ :py:class:`ServerApp`.
"""
name = 'serve-storage'
# You should have received a copy of the GNU General Public License along with
# Bugs Everywhere. If not, see <http://www.gnu.org/licenses/>.
-"""Define the :class:`Comment` class for representing bug comments.
+"""Define the :py:class:`Comment` class for representing bug comments.
"""
import base64
class Comment (Tree, settings_object.SavedSettingsObject):
- """Comments are a notes that attach to :class:`~libbe.bug.Bug`\s in
+ """Comments are a notes that attach to :py:class:`~libbe.bug.Bug`\s in
threaded trees. In mailing-list terms, a comment is analogous to
a single part of an email.
# You should have received a copy of the GNU General Public License along with
# Bugs Everywhere. If not, see <http://www.gnu.org/licenses/>.
-"""Tools for comparing two :class:`libbe.bug.BugDir`\s.
+"""Tools for comparing two :py:class:`libbe.bug.BugDir`\s.
"""
import difflib
# You should have received a copy of the GNU General Public License along with
# Bugs Everywhere. If not, see <http://www.gnu.org/licenses/>.
-"""Define the :class:`~libbe.storage.base.Storage` and
-:class:`~libbe.storage.base.VersionedStorage` classes for storing BE
+"""Define the :py:class:`~libbe.storage.base.Storage` and
+:py:class:`~libbe.storage.base.VersionedStorage` classes for storing BE
data.
Also define assorted implementations for the Storage classes:
# You should have received a copy of the GNU General Public License along with
# Bugs Everywhere. If not, see <http://www.gnu.org/licenses/>.
-"""Define an HTTP-based :class:`~libbe.storage.base.VersionedStorage`
+"""Define an HTTP-based :py:class:`~libbe.storage.base.VersionedStorage`
implementation.
See Also
class HTTP (base.VersionedStorage):
- """:class:`~libbe.storage.base.VersionedStorage` implementation over
+ """:py:class:`~libbe.storage.base.VersionedStorage` implementation over
HTTP.
Uses GET to retrieve information and POST to set information.
t.x.append(5) # external modification
t.x # dummy access notices change and triggers hook
- See :class:`testChangeHookMutableProperty` for an example of the
+ See :py:class:`testChangeHookMutableProperty` for an example of the
expected behavior.
Parameters
# You should have received a copy of the GNU General Public License along with
# Bugs Everywhere. If not, see <http://www.gnu.org/licenses/>.
-"""Provides :class:`SavedSettingsObject` implementing settings-dict
+"""Provides :py:class:`SavedSettingsObject` implementing settings-dict
based property storage.
See Also
properties.
This is useful for BE objects with saved properties
- (e.g. :class:`~libbe.bugdir.BugDir`, :class:`~libbe.bug.Bug`,
- :class:`~libbe.comment.Comment`). For example usage, consider the
+ (e.g. :py:class:`~libbe.bugdir.BugDir`, :py:class:`~libbe.bug.Bug`,
+ :py:class:`~libbe.comment.Comment`). For example usage, consider the
unittests at the end of the module.
See Also
# Bugs Everywhere. If not, see <http://www.gnu.org/licenses/>.
"""Define the Version Controlled System (VCS)-based
-:class:`~libbe.storage.base.Storage` and
-:class:`~libbe.storage.base.VersionedStorage` implementations.
+:py:class:`~libbe.storage.base.Storage` and
+:py:class:`~libbe.storage.base.VersionedStorage` implementations.
-There is a base class (:class:`~libbe.storage.vcs.VCS`) translating
+There is a base class (:py:class:`~libbe.storage.vcs.VCS`) translating
Storage language to VCS language, and a number of `VCS` implementations:
-* :class:`~libbe.storage.vcs.arch.Arch`
-* :class:`~libbe.storage.vcs.bzr.Bzr`
-* :class:`~libbe.storage.vcs.darcs.Darcs`
-* :class:`~libbe.storage.vcs.git.Git`
-* :class:`~libbe.storage.vcs.hg.Hg`
+* :py:class:`~libbe.storage.vcs.arch.Arch`
+* :py:class:`~libbe.storage.vcs.bzr.Bzr`
+* :py:class:`~libbe.storage.vcs.darcs.Darcs`
+* :py:class:`~libbe.storage.vcs.git.Git`
+* :py:class:`~libbe.storage.vcs.hg.Hg`
The base `VCS` class also serves as a filesystem Storage backend (not
versioning) in the event that a user has no VCS installed.
return Arch()
class Arch(base.VCS):
- """:class:`base.VCS` implementation for GNU Arch.
+ """:py:class:`base.VCS` implementation for GNU Arch.
"""
name = 'arch'
client = client
# You should have received a copy of the GNU General Public License along with
# Bugs Everywhere. If not, see <http://www.gnu.org/licenses/>.
-"""Define the base :class:`VCS` (Version Control System) class, which
+"""Define the base :py:class:`VCS` (Version Control System) class, which
should be subclassed by other Version Control System backends. The
base class implements a "do not version" VCS.
"""
return Bzr()
class Bzr(base.VCS):
- """:class:`base.VCS` implementation for Bazaar.
+ """:py:class:`base.VCS` implementation for Bazaar.
"""
name = 'bzr'
client = None # bzrlib module
return Darcs()
class Darcs(base.VCS):
- """:class:`base.VCS` implementation for Darcs.
+ """:py:class:`base.VCS` implementation for Darcs.
"""
name='darcs'
client='darcs'
class ExecGit (PygitGit):
- """:class:`base.VCS` implementation for Git.
+ """:py:class:`base.VCS` implementation for Git.
"""
name='git'
client='git'
return Hg()
class Hg(base.VCS):
- """:class:`base.VCS` implementation for Mercurial.
+ """:py:class:`base.VCS` implementation for Mercurial.
"""
name='hg'
client=None # mercurial module
return Monotone()
class Monotone (base.VCS):
- """:class:`base.VCS` implementation for Monotone.
+ """:py:class:`base.VCS` implementation for Monotone.
"""
name='monotone'
client='mtn'
Parameters
----------
- object : :class:`~libbe.bugdir.BugDir` or :class:`~libbe.bug.Bug` or :class:`~libbe.comment.Comment`
+ object : :py:class:`~libbe.bugdir.BugDir` or :py:class:`~libbe.bug.Bug` or :py:class:`~libbe.comment.Comment`
The object that the ID applies to.
type : 'bugdir' or 'bug' or 'comment'
The type of the object.
This is useful for separating data belonging to a particular
object directly from entries for its child objects. Since the
- :class:`~libbe.storage.base.Storage` backend doesn't distinguish
+ :py:class:`~libbe.storage.base.Storage` backend doesn't distinguish
between the two.
Examples
yield fields[0]
def long_to_short_user(bugdirs, id):
- """Convert a long user ID to a short user ID (see :class:`ID`).
+ """Convert a long user ID to a short user ID (see :py:class:`ID`).
The list of bugdirs allows uniqueness-maintaining truncation of
the bugdir portion of the ID.
return _assemble(ids)
def short_to_long_user(bugdirs, id):
- """Convert a short user ID to a long user ID (see :class:`ID`). The
+ """Convert a short user ID to a long user ID (see :py:class:`ID`). The
list of bugdirs allows uniqueness-checking during expansion of the
bugdir portion of the ID.
return replacement
def short_to_long_text(bugdirs, text):
- """Convert short user IDs to long user IDs in text (see :class:`ID`).
+ """Convert short user IDs to long user IDs in text (see :py:class:`ID`).
The list of bugdirs allows uniqueness-checking during expansion of
the bugdir portion of the ID.
REGEXP, IDreplacer(bugdirs, short_to_long_user, strict=False), text)
def long_to_short_text(bugdirs, text):
- """Convert long user IDs to short user IDs in text (see :class:`ID`).
+ """Convert long user IDs to short user IDs in text (see :py:class:`ID`).
The list of bugdirs allows uniqueness-maintaining truncation of
the bugdir portion of the ID.
return ('/'.join(root_ids), '/'.join(residual_ids))
def _parse_user(id):
- """Parse a user ID (see :class:`ID`), returning a dict of parsed
+ """Parse a user ID (see :py:class:`ID`), returning a dict of parsed
information.
The returned dict will contain a value for "type" (from
return ret
def parse_user(bugdirs, id):
- """Parse a user ID (see :class:`ID`), returning a dict of parsed
+ """Parse a user ID (see :py:class:`ID`), returning a dict of parsed
information.
The returned dict will contain a value for "type" (from
# You should have received a copy of the GNU General Public License along with
# Bugs Everywhere. If not, see <http://www.gnu.org/licenses/>.
-"""Define :class:`Tree`, a traversable tree structure.
+"""Define :py:class:`Tree`, a traversable tree structure.
"""
import libbe
----------
type : str
String identifying `*`, e.g. "bug", "comment", ...
- element : :class:`ElementTree.Element`
+ element : :py:class:`ElementTree.Element`
ElementTree.Element instance which caused the error.
error : str
Error description.