Skip to content

Commit

Permalink
Create commands.py and entry points in setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelbabu committed Mar 13, 2013
1 parent 3d374cd commit 7a972d4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
28 changes: 28 additions & 0 deletions ckanext/sa/commands.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from ckan.lib.cli import CkanCommand

import logging
logger = logging.getLogger()


class DataStore(CkanCommand):
"""
Upload all resources from the FileStore to the DataStore
Usage:
paster datastore [package-id]
- Update all resources or just those belonging to a specific
package if a package id is provided.
"""
summary = __doc__.split('\n')[0]
usage = __doc__
min_args = 0
max_args = 1
MAX_PER_PAGE = 50

def command(self):
"""
Parse command line arguments and call the appropriate method
"""
print "here"
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@
],
entry_points=\
"""
[ckan.plugins]
[paste.paster_command]
datastore = ckanext.sa.commands:DataStore
[ckan.plugins]
# Add plugins here
sa_customizations=ckanext.sa.plugin:SACustomizations
sa_customizations=ckanext.sa.plugin:SACustomizations
""",
)

0 comments on commit 7a972d4

Please sign in to comment.