Package: cartman
cartmanallows you to create and manage yourTractickets from the
command-line, without the need to setup physical access to theTracinstallation/database or even the need to install a plugin onTrac.  All you
need is aTracaccount.ExamplesCreate a new ticket, that will open your $EDITOR:$ cm newView the content of a ticket:$ cm view 1514ConfigurationAt a minimum you need to create a~/.cartman/configfile with the
following:[trac]
base_url = http://your.trac.install/
username = tamentis
password = sitnematThe password can also be specified through aTRAC_PASSWORDenvironment variable, which overrides the abovepasswordfield.Configuration OptionsEach section represent a site which can be selected using the-scommand-line argument.  Within each section, the following settings are
available:base_url- required, defines the URL of your Trac systemauth_type- forces an authentication type, currently available:basic(default),digest,acctmgrornone.username- required ifauth_typeis notnonepassword- required ifauth_typeis notnoneverify_ssl_cert- ignore self-signed or invalid SSL certificates if set
to false.editor- override the editor defined the$EDITORenvironment
variable.Command walk throughReport Listing and SearchDump a list of tickets on screen, without details:$ cm report 1
#142. fix world hunger (bjanin@)
#159. ignore unpaid rent (bjanin@)Another way to find ticket is using the search command:$ cm search dead mouse
#154. mickeyTicket ViewShow all the properties of a ticket:$ cm view 1List of ReportsGet a list of all the available reports with:$ cm reportsSystem PropertiesThis will dump on screen all the Milestones, Components, Versions:$ cm propertiesCreating a ticketCreating a ticket will work similarly to writing a new email inmutt, it loads
your current$EDITORand lets you edit the details of the ticket. Assuming
all the parameters are correct, it will create the ticket as soon as you save
and exit and return the ticket number. If your ticket does not appear valid
(missing required field, inexistent Milestone, etc.)cartmanwill stop and
lists each error and let you return to your editor:$ cm new
-- opens your editor --

Found the following errors:
 - Invalid 'Subject': cannot be blank
 - Invalid 'Milestone': expected: Bug Bucket, Release 2, Release 3

-- Hit Enter to return to editor, ^C to abort --The first parameter tocmis the owner of the ticket, it populates theTofield by default:$ cm new jcarmackIf your Trac has custom fields, you can use their identifier in the headers,
e.g.:story_id: 5123
iteration: 15If you specify a template with -t, cartman will look for a matching file in the~/.cartman/templatesfolder and will use it as a base for your ticket:$ cm new -t sysadminYou can define adefaulttemplate in this same directory in order to set
the template used by default (without-t).Commenting on a ticketJust like creating a ticket, adding a comment is just likemutt, your current$EDITORwill be loaded on a blank file for you to edit. Upon save and exit,cartmanwill commit this new comment and return silently, unless an error
occurs:$ cm comment 1If the comment is short enough to fit on the command line, you may use the-mflag as such:$ cm comment 1 -m "you forgot to call twiddle()"View/Set the status of a ticketView the current status of a ticket, and the available statuses:$ cm status 1Set a ticket as accepted:$ cm status 1 acceptIf you need to add a comment with this status change, you can use the-cflag, it will open your default editor:$ cm status 1 reopen -cYou may also use the-mflag to define the comment in-line, without the use
of an editor:$ cm status 1 reopen -m "does not work with x = y"Advanced configurationIf you are usingvimas your default editor, you also might want to add
email-like syntax highlighting to match the.cm.ticketextension:autocmd BufNewFile *.cm.ticket setf mailIf you use multiple Trac sites, you can have multiple configurations in the
same file using the section to separate the sites, here is an example:[other]
base_url = http://other.trac.site/
username = tamentis
password = sitnemat
verify_ssl_cert = FalseYou would pass the-sparameter tocmto define which site to access:cm -s other report 1You may define all common configuration settings in the[DEFAULT]section.Using cartman without editorYou may need to integrate cartman with other software where opening an editor
does not make sense.  In that case you can automatically create tickets from
a file using the--message-fileoption:cm new --message-file=secerror.txtThis file would need to contain a complete ticket, if anything is missing,
cartman will exit with an error message.InstallationQuick and dirty if you are not familiar with Python packaging:sudo python setup.py installRequirementsPython 2.7+, 3.3+ (not 3.2, not 2.6)python-requests 1.2 and aboveCompatibilityTested on Trac 0.12.5 and 1.2.xProbably still works on 0.11, but untested.HackingThe following command will create one virtualenv and sandbox for each latest
0.12, 1.0 and 1.2 releases of Trac:$ ./tools/mkenv.shYou can then serve one or the other using, the default admin user/pass is
sandbox/sandbox:$ ./tools/serve-0.12.sh
$ ./tools/serve-1.0.sh
$ ./tools/serve-1.2.shFollow PEP-8, existing style then the following notes.For dictionaries, lists: keep commas after each items, closing bracket
should close on the same column as the first letter of the statement with the
opening bracket.Use double-quotes for strings unless it makes it easier on certain strings
(avoids escaped double-quotes).If an error is exceptional, let the exception rise.DistributeChange the version in cartman/__init__.py, update CHANGES.txtCommitCreate a tag:git tag -a vX.Y.Z -m 'Releasing vX.Y.Z'
git push --tagsDownload the file from github (release section),Sign it:gpg --armor --detach-sig cartman-X.Y.Z.tar.gzDistribute on Pypi:python setup.py sdist upload