Difference between revisions of "Command Line Tools"

From Creative Commons
Jump to: navigation, search
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
[[Category:opensource]]
 +
[[Category:Technology]]
 
[[Category:Developer]]
 
[[Category:Developer]]
{{stub}}
 
  
 
The CC Command Line Interface Tools (CLI Tools) are a set of Python scripts which can be used to insert or read license information from the command line.  The basic scripts are stored in the <code>cli-tools</code> module in Berlios SVN.
 
The CC Command Line Interface Tools (CLI Tools) are a set of Python scripts which can be used to insert or read license information from the command line.  The basic scripts are stored in the <code>cli-tools</code> module in Berlios SVN.
 +
 +
'''These tools currently lag behind [[CcLookup]] in functionality.  They will be updated when the libraries for [[CcLookup]] stabilize.'''
  
 
== Getting the CLI Tools From Subversion ==
 
== Getting the CLI Tools From Subversion ==
  
The primary tool scripts are stored in the <code>cli-tools</code> module in Berlios SVN.  The scripts also rely on additional modules, which are tracked using <code>svn:externals</code> properties.  To check out a working copy of the trunk from anonymous SVN into a directory named cli-tools, issue the following command (Linux or Mac OS X):
+
The primary tool scripts are stored in the <code>cli-tools</code> module in Berlios SVN.  To check out a working copy of the trunk from anonymous SVN into a directory named cli-tools, issue the following command (Linux or Mac OS X):
  
   svn checkout svn://svn.berlios.de/cctools/cli-tools/trunk cli-tools
+
   $ svn checkout svn://svn.berlios.de/cctools/cli-tools/trunk cli-tools
  
 
That's it; you're all set.
 
That's it; you're all set.
 +
 +
== Building the Tools ==
 +
 +
The CC CLI Tools are written in Python, and utilize [http://python.org/pypi/zc.buildout zc.buildout] for the build process.  Starting with the Python interpreter, the Subversion checkout can download and build the necessary dependencies.  To start the buildout process, you need to bootstrap your installation:
 +
 +
  $ cd cli-tools
 +
  $ python bootstrap/bootstrap.py
 +
 +
The bootstrap script will download zc.buildout and [http://peak.telecommunity.com/DevCenter/setuptools setuptools], which are required to complete the build process.  After you have bootstrapped your checkout, you can build the software:
 +
 +
  $ ./bin/buildout
 +
 +
The buildout process will grab Python Eggs for the software dependencies.  The scripts will be placed in the <code>./bin</code> subdirectory.  Note that these scripts will contain '''absolute paths''' to the dependency eggs.
  
 
== Using the CLI Tools ==
 
== Using the CLI Tools ==
  
This page describes how to use the current command line interface tools.  This page assumes you've already [[/Developer/Projects/CmdLine/GetCliTools|checked out]] the tools.
+
This page describes how to use the current command line interface tools.  This page assumes you've already checked out and built the tools as described above.
  
=== cct.py ===
+
=== cct ===
  
<code>cct.py</code> is used to embed a license claim in a file and generate the cooresponding license RDF.  Currently MP3 is the only supported format. Running <code>cct.py</code> with the <code>--help</code> flag will show a simple help screen:
+
<code>cct</code> is used to embed a license claim in a file and generate the cooresponding license RDF.  Currently MP3 is the only supported format. Running <code>cct</code> with the <code>--help</code> flag will show a simple help screen:
  
  $ python cct.py --help
+
  $ ./bin/cct --help
  usage: cct.py [options] filenames  
+
  usage: cct [options] filenames  
 
  options:
 
  options:
 
   -o HOLDER, --holder=HOLDER
 
   -o HOLDER, --holder=HOLDER
Line 33: Line 49:
 
   -h, --help            show this help message and exit
 
   -h, --help            show this help message and exit
  
=== ccl.py ===
+
=== ccl ===
  
<code>ccl.py</code> is used to examine a license claim embedded in a file.  If a verification URL is specified, ccl.py will attempt to verify the license claim.  Currently MP3 is the only supported format. Running <code>ccl.py</code> with the <code>--help</code> flag will show a simple help screen:
+
<code>ccl</code> is used to examine a license claim embedded in a file.  If a verification URL is specified, ccl.py will attempt to verify the license claim.  Currently MP3 is the only supported format. Running <code>ccl</code> with the <code>--help</code> flag will show a simple help screen:
  
  $ python ccl.py --help
+
  $ ./bin/ccl --help
  usage: ccl.py [options] filenames
+
  usage: ccl [options] filenames
 
  options:
 
  options:
 
   -d, --display  Display the license claim; do not verify.
 
   -d, --display  Display the license claim; do not verify.
Line 44: Line 60:
 
   -h, --help    show this help message and exit
 
   -h, --help    show this help message and exit
  
=== claim.py ===
+
=== claim ===
  
<code>claim.py</code> is used to embed a license claim in a file.  Unlike cct.py, claim.py does not generate verification RDF, and takes a fully formed TCOP statement instead of the pieces needed to generate one.  Currently MP3 is the only supported format. Running <code>claim.py</code> with the <code>--help</code> flag will show a simple help screen:
+
<code>claim</code> is used to embed a license claim in a file.  Unlike cct, claim does not generate verification RDF, and takes a fully formed TCOP statement instead of the pieces needed to generate one.  Currently MP3 is the only supported format. Running <code>claim</code> with the <code>--help</code> flag will show a simple help screen:
  
  $ python claim.py --help
+
  $ python claim --help
  usage: claim.py [options] filenames
+
  usage: claim [options] filenames
 
  options:
 
  options:
 
   -t TCOP, --tcop=TCOP  Complete copyright statement to embed.
 
   -t TCOP, --tcop=TCOP  Complete copyright statement to embed.
 
   --version            show program's version number and exit
 
   --version            show program's version number and exit
 
   -h, --help            show this help message and exit
 
   -h, --help            show this help message and exit
 
This page contains basic developer documentation for the CC [[/Developer/Projects/CmdLine|CLI Tools]].
 
 
== Hacking the CLI Tools ==
 
 
=== Adding file formats ===
 
 
== Building and Distributing ==
 
 
=== Linux ===
 
=== Mac OS X ===
 
=== Windows ===
 

Latest revision as of 17:17, 20 February 2007


The CC Command Line Interface Tools (CLI Tools) are a set of Python scripts which can be used to insert or read license information from the command line. The basic scripts are stored in the cli-tools module in Berlios SVN.

These tools currently lag behind CcLookup in functionality. They will be updated when the libraries for CcLookup stabilize.

Getting the CLI Tools From Subversion

The primary tool scripts are stored in the cli-tools module in Berlios SVN. To check out a working copy of the trunk from anonymous SVN into a directory named cli-tools, issue the following command (Linux or Mac OS X):

 $ svn checkout svn://svn.berlios.de/cctools/cli-tools/trunk cli-tools

That's it; you're all set.

Building the Tools

The CC CLI Tools are written in Python, and utilize zc.buildout for the build process. Starting with the Python interpreter, the Subversion checkout can download and build the necessary dependencies. To start the buildout process, you need to bootstrap your installation:

 $ cd cli-tools
 $ python bootstrap/bootstrap.py

The bootstrap script will download zc.buildout and setuptools, which are required to complete the build process. After you have bootstrapped your checkout, you can build the software:

 $ ./bin/buildout

The buildout process will grab Python Eggs for the software dependencies. The scripts will be placed in the ./bin subdirectory. Note that these scripts will contain absolute paths to the dependency eggs.

Using the CLI Tools

This page describes how to use the current command line interface tools. This page assumes you've already checked out and built the tools as described above.

cct

cct is used to embed a license claim in a file and generate the cooresponding license RDF. Currently MP3 is the only supported format. Running cct with the --help flag will show a simple help screen:

$ ./bin/cct --help
usage: cct [options] filenames 
options:
  -o HOLDER, --holder=HOLDER
                        The copyright holder for the files
  -y YEAR, --year=YEAR  The copyright year for the files
  -l LICENSE, --license=LICENSE
                        URL of the embedded license
  -v VALIDATION, --validation=VALIDATION
                        Validation URL for this file
  --version             show program's version number and exit
  -h, --help            show this help message and exit

ccl

ccl is used to examine a license claim embedded in a file. If a verification URL is specified, ccl.py will attempt to verify the license claim. Currently MP3 is the only supported format. Running ccl with the --help flag will show a simple help screen:

$ ./bin/ccl --help
usage: ccl [options] filenames
options:
  -d, --display  Display the license claim; do not verify.
  --version      show program's version number and exit
  -h, --help     show this help message and exit

claim

claim is used to embed a license claim in a file. Unlike cct, claim does not generate verification RDF, and takes a fully formed TCOP statement instead of the pieces needed to generate one. Currently MP3 is the only supported format. Running claim with the --help flag will show a simple help screen:

$ python claim --help
usage: claim [options] filenames
options:
  -t TCOP, --tcop=TCOP  Complete copyright statement to embed.
  --version             show program's version number and exit
  -h, --help            show this help message and exit