Re: CLI interface in the works, anyone interested?



On 2010-03-07 07:36, Barry Jackson wrote:
> On 03/03/10 05:57, Gabriel Filion wrote:
> 
>>
>> So, if anyone of you are interested in this, please have a look at the
>> code over at Github:
>>
>> http://github.com/lelutin/tomtom
>>
>> Support for gnote was not yet added, but it is in the highest priority
>> in my list. If you want to try using it and you understand Python, you
>> can simply change "Tomboy" to "Gnote" in the connection strings in the
>> file "src/tomtom/core.py" in the Tomtom.__init__ function. I could also
>> supply a patch to make things easier.
>>
>> Enjoy!
>>
> 
> Thanks - this is interesting as I use gnote.
> However  __init__.py seems to be empty, unless I am looking in the wrong
> place ?

Here's a bit more detail on the repository's organisation. First, a tree
of the directories that are in there, then a short explanation for each
directory:

tomtom.git
└── src
    ├── test
    └── tomtom
        └── actions

The root directory contains information textfiles, and the "setup.py"
file. This last file defines an "entry point" for setuptools to
automatically generate a script that calls
"tomtom.cli.exception_wrapped_main" (from src/tomtom, see below).

The src directory contains all source code. Nothing much of interest
here, only an empty __init__.py that makes this directory behave as a
python module (for importing files).

The src/test directory contains python code for tests on the
application. Tests are developped with "unittest.TestCase" clases so
they can be run with unittest alone, but they do require the pymox
package. I personally use nose to run tests, it offers code coverage and
pdb integration.

The src/tomtom directory is the one holding all the application code.
This directory will be installed by setuptools in your python path.

src/tomtom/actions contains actions availble to tomtom. However, simply
dropping a file here before installing doesn't create a new action. An
action needs to define an "entry point" (see the setup.py file for
examples with the four actions currently available). Actions could be
developed in a different project, as long as they use the right entry
point, tomtom will find them.

All the __init__.py files are empty; used only as placeholders for
python to consider the directories as packages.

That's pretty much it. I hope this helps you dig inside the code better.

-- 
Gabriel Filion


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]