lesana.command module

class lesana.command.Command(collection_class=<class 'lesana.collection.Collection'>, entry_class=<class 'lesana.collection.Entry'>)[source]

Bases: object

edit_file_in_external_editor(filepath)[source]
class lesana.command.Edit(collection_class=<class 'lesana.collection.Collection'>, entry_class=<class 'lesana.collection.Entry'>)[source]

Bases: lesana.command.Command

Edit a lesana entry

arguments = [(['--collection', '-c'], {'help': 'The collection to work on (default .)'}), (['--no-git'], {'help': "Don't add the new entry to git", 'action': 'store_false', 'dest': 'git'}), (['eid'], {'help': 'eid of an entry to edit'})]
main()[source]
class lesana.command.Export(collection_class=<class 'lesana.collection.Collection'>, entry_class=<class 'lesana.collection.Entry'>)[source]

Bases: lesana.command.Command

Export entries to a different collection

arguments = [(['--collection', '-c'], {'help': 'The collection to work on (default .)'}), (['--query', '-q'], {'help': 'Xapian query to search in the collection'}), (['destination'], {'help': 'The collection to export entries to'}), (['template'], {'help': 'Template to convert entries'})]
main()[source]
class lesana.command.GetValues(collection_class=<class 'lesana.collection.Collection'>, entry_class=<class 'lesana.collection.Entry'>)[source]

Bases: lesana.command.Command

List all values for one field, with entry counts.

arguments = [(['--collection', '-c'], {'help': 'The collection to work on (default .)'}), (['--field', '-f'], {'help': 'Name of the field', 'required': True}), (['--template', '-t'], {'help': 'Template to use when displaying results'}), (['query'], {'help': 'Xapian query to limit the count search " + "in the collection', 'nargs': '*', 'default': '*'})]
main()[source]
class lesana.command.Index(collection_class=<class 'lesana.collection.Collection'>, entry_class=<class 'lesana.collection.Entry'>)[source]

Bases: lesana.command.Command

Index entries in a lesana collection

arguments = [(['--collection', '-c'], {'help': 'The collection to work on (default .)'}), (['--reset'], {'action': 'store_true', 'help': 'Delete the existing index and reindex from scratch.'}), (['files'], {'help': 'List of files to index (default: everything)', 'default': None, 'nargs': '*'})]
main()[source]
class lesana.command.Init(collection_class=<class 'lesana.collection.Collection'>, entry_class=<class 'lesana.collection.Entry'>)[source]

Bases: lesana.command.Command

Initialize a lesana collection

arguments = [(['--collection', '-c'], {'help': 'The directory to work on (default .)', 'default': '.'}), (['--no-git'], {'help': 'Skip setting up git in this directory', 'action': 'store_false', 'dest': 'git'})]
main()[source]
class lesana.command.MainCommand[source]

Bases: object

commands = ()
main()[source]
class lesana.command.New(collection_class=<class 'lesana.collection.Collection'>, entry_class=<class 'lesana.collection.Entry'>)[source]

Bases: lesana.command.Command

Create a new entry

arguments = [(['--collection', '-c'], {'help': 'The collection to work on (default .)'}), (['--no-git'], {'help': "Don't add the new entry to git", 'action': 'store_false', 'dest': 'git'})]
main()[source]
class lesana.command.Remove(collection_class=<class 'lesana.collection.Collection'>, entry_class=<class 'lesana.collection.Entry'>)[source]

Bases: lesana.command.Command

Remove an entry from a collection

arguments = [(['--collection', '-c'], {'help': 'The collection to work on (default .)'}), (['entries'], {'help': 'List of entries to remove', 'nargs': '+'})]
main()[source]
class lesana.command.Search(collection_class=<class 'lesana.collection.Collection'>, entry_class=<class 'lesana.collection.Entry'>)[source]

Bases: lesana.command.Command

Search for entries

arguments = [(['--collection', '-c'], {'help': 'The collection to work on (default .)'}), (['--template', '-t'], {'help': 'Template to use when displaying results'}), (['--offset'], {'type': <class 'int'>}), (['--pagesize'], {'type': <class 'int'>}), (['--all'], {'action': 'store_true', 'help': 'Return all available results'}), (['--sort'], {'action': 'append', 'help': 'Sort results by a sortable field'}), (['query'], {'help': 'Xapian query to search in the collection', 'nargs': '*', 'default': '*'})]
main()[source]
class lesana.command.Show(collection_class=<class 'lesana.collection.Collection'>, entry_class=<class 'lesana.collection.Entry'>)[source]

Bases: lesana.command.Command

Show a lesana entry

arguments = [(['--collection', '-c'], {'help': 'The collection to work on (default .)'}), (['--template', '-t'], {'help': 'Use the specified template to display results.'}), (['eid'], {'help': 'eid of an entry to edit'})]
main()[source]
class lesana.command.Update(collection_class=<class 'lesana.collection.Collection'>, entry_class=<class 'lesana.collection.Entry'>)[source]

Bases: lesana.command.Command

Update a field in multiple entries

arguments = [(['--collection', '-c'], {'help': 'The collection to work on (default .)'}), (['--field', '-f'], {'help': 'The field to change'}), (['--value', '-t'], {'help': 'The value to set'}), (['query'], {'help': 'Xapian query to search in the collection', 'nargs': '+'})]
main()[source]