-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Cement Templates for Cement 2.10
- Loading branch information
Showing
8 changed files
with
24 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,9 @@ class Meta: | |
# Internal templates (ship with application code) | ||
template_module = '@[email protected]' | ||
|
||
# call sys.exit() when app.close() is called | ||
exit_on_close = True | ||
|
||
|
||
class @class_prefix@TestApp(@class_prefix@App): | ||
"""A test app that is better suited for testing.""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
cement>=2.6.0 | ||
cement>=2.10.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,16 +9,18 @@ | |
|
||
from cement.core.foundation import CementApp | ||
from cement.utils.misc import init_defaults | ||
from cement.core.controller import CementBaseController, expose | ||
from cement.ext.ext_argparse import ArgparseController, expose | ||
from cement.core.exc import FrameworkError, CaughtSignal | ||
|
||
|
||
defaults = init_defaults('@module@') | ||
defaults['@module@'] = dict( | ||
debug=False, | ||
foo='bar', | ||
) | ||
|
||
class @class_prefix@BaseController(CementBaseController): | ||
|
||
class @class_prefix@BaseController(ArgparseController): | ||
class Meta: | ||
label = 'base' | ||
description = '@description@' | ||
|
@@ -30,11 +32,14 @@ class Meta: | |
def default(self): | ||
print("Inside @[email protected]()") | ||
|
||
|
||
class @class_prefix@App(CementApp): | ||
class Meta: | ||
label = '@module@' | ||
base_controller = @class_prefix@BaseController | ||
config_defaults = defaults | ||
exit_on_close = True | ||
|
||
|
||
def main(): | ||
with @class_prefix@App() as app: | ||
|
@@ -51,5 +56,6 @@ def main(): | |
print('CaughtSignal > %s' % e) | ||
app.exit_code = 0 | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |