Commits

Anonymous committed 0fcb167

Documentation patch

Comments (0)

Files changed (2)

 # |version| and |release|, also used in various other places throughout the
 # built documents.
 #
+# The full version, including alpha/beta/rc tags.
+from ordf import version as release
 # The short X.Y version.
-version = '0.6'
-# The full version, including alpha/beta/rc tags.
-release = '0.6'
+version = ".".join(release.split(".")[:2])
+
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
     INFO  [ordf.load_n3/3148] Loading http://ordf.org/lens/rdfs
     INFO  [ordf.changeset] 612 changes urn:uuid:171ffd8c-8d12-11df-850a-001f5bef60ee
 
+In addition to the *-c* for specifying the config file and *-l* and *-v*
+for log file and debugging as with  :program:`ordf`, :program:`ordf_load_n3`
+supports these arguments:
+
 .. cmdoption:: -p, --package
 
     Name of the package (python module) to look for N3 fixtures in. This
     The Base URI for loading graphs into. The URI of the graph will be
     *base* + *filename* where *filename* has had the *.n3* extension
     stripped.
+
+Command Implementation -- :class:`Command`
+==========================================
+
+.. autoclass:: Command
 """
 from ordf.graph import Graph
 from ordf.handler import init_handler
 import sys
 
 class Command(object):
+    """
+    This class is very similar to :class:`paste.script.command.Command` but
+    rather than implementing a :program:`paster` plugin it is for stand-alone
+    command line programs. To implement a command line program, sub-class this
+    class, and make a minimal method to instantiate and run it. As with the
+    paster counterpart you have to add an option parser and a method called 
+    :meth:`command`. A minimal example:
+
+    .. code-block:: python
+
+        class Hello(Command):
+            parser = Command.StandardParser(usage="%prog [options]")
+            def command(self):
+                print "hello world"
+
+        def hello():
+            Hello().command()
+
+    To create the actual script, in your package's *setup.py* needs an entry
+    point like::
+
+        [console_scripts]
+        hello=mypackage.command:hello
+
+    and then run one of::
+
+        % python setup.py develop
+        % python setup.py install
+    """
     def __init__(self):
         self.parse_args()
         self.parse_config()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.