Skip to content

Commit

Permalink
[#533] Change paster commands docs to follow paster's conventions
Browse files Browse the repository at this point in the history
In paster's documentation, a required field is shown in UPPER_CASE, and
underscores are used as word separator.

Conflicts:

	ckan/lib/cli.py
  • Loading branch information
vitorbaptista authored and amercader committed Apr 15, 2013
1 parent f9dc280 commit f94013d
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 53 deletions.
101 changes: 51 additions & 50 deletions ckan/lib/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,21 @@ def _setup_app(self):
class ManageDb(CkanCommand):
'''Perform various tasks on the database.
db create # alias of db upgrade
db init # create and put in default data
db create - alias of db upgrade
db init - create and put in default data
db clean
db upgrade [{version no.}] # Data migrate
db version # returns current version of data schema
db dump {file-path} # dump to a pg_dump file
db dump-rdf {dataset-name} {file-path}
db simple-dump-csv {file-path} # dump just datasets in CSV format
db simple-dump-json {file-path} # dump just datasets in JSON format
db user-dump-csv {file-path} # dump user information to a CSV file
db send-rdf {talis-store} {username} {password}
db load {file-path} # load a pg_dump from a file
db load-only {file-path} # load a pg_dump from a file but don\'t do
# the schema upgrade or search indexing
db create-from-model # create database from the model (indexes not made)
db upgrade [version no.] - Data migrate
db version - returns current version of data schema
db dump FILE_PATH - dump to a pg_dump file
db dump-rdf DATASET_NAME FILE_PATH
db simple-dump-csv FILE_PATH - dump just datasets in CSV format
db simple-dump-json FILE_PATH - dump just datasets in JSON format
db user-dump-csv FILE_PATH - dump user information to a CSV file
db send-rdf TALIS_STORE USERNAME PASSWORD
db load FILE_PATH - load a pg_dump from a file
db load-only FILE_PATH - load a pg_dump from a file but don\'t do
the schema upgrade or search indexing
db create-from-model - create database from the model (indexes not made)
'''
summary = __doc__.split('\n')[0]
usage = __doc__
Expand Down Expand Up @@ -312,10 +312,12 @@ class SearchIndexCommand(CkanCommand):
'''Creates a search index for all datasets
Usage:
search-index [-i] [-o] [-r] [-e] rebuild [dataset-name] - reindex dataset-name if given, if not then rebuild full search index (all datasets)
search-index check - checks for datasets not indexed
search-index show {dataset-name} - shows index of a dataset
search-index clear [dataset-name] - clears the search index for the provided dataset or for the whole ckan instance
search-index [-i] [-o] [-r] [-e] rebuild [dataset_name] - reindex dataset_name if given, if not then rebuild
full search index (all datasets)
search-index check - checks for datasets not indexed
search-index show DATASET_NAME - shows index of a dataset
search-index clear [dataset_name] - clears the search index for the provided dataset or
for the whole ckan instance
'''

summary = __doc__.split('\n')[0]
Expand Down Expand Up @@ -434,7 +436,7 @@ def command(self):


class RDFExport(CkanCommand):
'''
'''Export active datasets as RDF
This command dumps out all currently active datasets as RDF into the
specified folder.
Expand Down Expand Up @@ -498,8 +500,8 @@ class Sysadmin(CkanCommand):
Usage:
sysadmin - lists sysadmins
sysadmin list - lists sysadmins
sysadmin add <user-name> - add a user as a sysadmin
sysadmin remove <user-name> - removes user from sysadmins
sysadmin add USERNAME - add a user as a sysadmin
sysadmin remove USERNAME - removes user from sysadmins
'''

summary = __doc__.split('\n')[0]
Expand Down Expand Up @@ -579,16 +581,16 @@ class UserCmd(CkanCommand):
Usage:
user - lists users
user list - lists users
user <user-name> - shows user properties
user add <user-name> [<field>=<value>]
user USERNAME - shows user properties
user add USERNAME [FIELD1=VALUE1 FIELD2=VALUE2 ...]
- add a user (prompts for password
if not supplied).
Field can be: apikey
password
email
user setpass <user-name> - set user password (prompts)
user remove <user-name> - removes user from users
user search <query> - searches for a user name
user setpass USERNAME - set user password (prompts)
user remove USERNAME - removes user from users
user search QUERY - searches for a user name
'''
summary = __doc__.split('\n')[0]
usage = __doc__
Expand Down Expand Up @@ -735,11 +737,11 @@ class DatasetCmd(CkanCommand):
'''Manage datasets
Usage:
dataset <dataset-name/id> - shows dataset properties
dataset show <dataset-name/id> - shows dataset properties
dataset DATASET_NAME|ID - shows dataset properties
dataset show DATASET_NAME|ID - shows dataset properties
dataset list - lists datasets
dataset delete <dataset-name/id> - changes dataset state to 'deleted'
dataset purge <dataset-name/id> - removes dataset from db entirely
dataset delete [DATASET_NAME|ID] - changes dataset state to 'deleted'
dataset purge [DATASET_NAME|ID] - removes dataset from db entirely
'''
summary = __doc__.split('\n')[0]
usage = __doc__
Expand Down Expand Up @@ -816,12 +818,11 @@ class Celery(CkanCommand):
'''Celery daemon
Usage:
celeryd - run the celery daemon
celeryd run - run the celery daemon
celeryd run concurrency - run the celery daemon with
argument 'concurrency'
celeryd view - view all tasks in the queue
celeryd clean - delete all tasks in the queue
celeryd <run> - run the celery daemon
celeryd run concurrency - run the celery daemon with
argument 'concurrency'
celeryd view - view all tasks in the queue
celeryd clean - delete all tasks in the queue
'''
min_args = 0
max_args = 2
Expand Down Expand Up @@ -940,8 +941,8 @@ class Tracking(CkanCommand):
'''Update tracking statistics
Usage:
tracking update [start-date] - update tracking stats
tracking export <file> [start-date] - export tracking stats to a csv file
tracking update [start_date] - update tracking stats
tracking export FILE [start_date] - export tracking stats to a csv file
'''

summary = __doc__.split('\n')[0]
Expand Down Expand Up @@ -1116,7 +1117,7 @@ def update_tracking(self, engine, summary_date):
engine.execute(sql)

class PluginInfo(CkanCommand):
''' Provide info on installed plugins.
'''Provide info on installed plugins.
'''

summary = __doc__.split('\n')[0]
Expand Down Expand Up @@ -1220,8 +1221,8 @@ class CreateTestDataCommand(CkanCommand):
create-test-data user - create a user 'tester' with api key 'tester'
create-test-data translations - annakarenina, warandpeace, and some test
translations of terms
create-test-data vocabs - annakerenina, warandpeace, and some test
vocabularies
create-test-data vocabs - annakerenina, warandpeace, and some test
vocabularies
'''
summary = __doc__.split('\n')[0]
Expand Down Expand Up @@ -1271,7 +1272,7 @@ class Profile(CkanCommand):
by runsnakerun.
Usage:
profile {url}
profile URL
e.g. profile /data/search
Expand Down Expand Up @@ -1332,11 +1333,11 @@ class CreateColorSchemeCommand(CkanCommand):
less will need to generate the css files after this has been run
color - creates a random color scheme
color clear - clears any color scheme
color '<hex>' - uses as base color eg '#ff00ff' must be quoted.
color <value> - a float between 0.0 and 1.0 used as base hue
color <color name> - html color name used for base color eg lightblue
color - creates a random color scheme
color clear - clears any color scheme
color <'HEX'> - uses as base color eg '#ff00ff' must be quoted.
color <VALUE> - a float between 0.0 and 1.0 used as base hue
color <COLOR_NAME> - html color name used for base color eg lightblue
'''

summary = __doc__.split('\n')[0]
Expand Down Expand Up @@ -1587,8 +1588,8 @@ def command(self):
class TranslationsCommand(CkanCommand):
'''Translation helper functions
trans js - generate the javascript translations
trans mangle - mangle the zh_TW translations for testing
trans js - generate the javascript translations
trans mangle - mangle the zh_TW translations for testing
'''

summary = __doc__.split('\n')[0]
Expand Down Expand Up @@ -1744,7 +1745,7 @@ class MinifyCommand(CkanCommand):
Usage:
paster minify [FILE|DIRECTORY] ...
paster minify [--clean] PATH
for example:
Expand Down
6 changes: 3 additions & 3 deletions doc/paster.rst
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ Sets the authorization roles of a specific user on a given object within the sys

For example, to give the user named 'bar' the 'admin' role on the dataset 'foo'::

paster --plugin=ckan rights make bar admin package:foo --config=/etc/ckan/std/std.ini
paster --plugin=ckan rights make bar admin package:foo --config=/etc/ckan/std/std.ini

To list all the rights currently specified::

Expand Down Expand Up @@ -279,8 +279,8 @@ won't clear the index before starting rebuilding it::
There are other search related commands, mostly useful for debugging purposes::

search-index check - checks for datasets not indexed
search-index show {dataset-name} - shows index of a dataset
search-index clear [dataset-name] - clears the search index for the provided dataset or for the whole ckan instance
search-index show DATASET_NAME - shows index of a dataset
search-index clear [DATASET_NAME] - clears the search index for the provided dataset or for the whole ckan instance



Expand Down

0 comments on commit f94013d

Please sign in to comment.