Skip to content

Commit

Permalink
update mana init
Browse files Browse the repository at this point in the history
  • Loading branch information
misakar committed Oct 30, 2015
1 parent 60fcc41 commit 84e9112
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ mana

|-app/ ---- __init__.py
|-test/
my_project - | views.py
my_project - |-manage.py views.py
|-requirement.txt forms.py
|-README.md templates
| static
Expand Down Expand Up @@ -198,6 +198,8 @@ ex:
2015-1030: delete sql and add --sql --config to init
----------------------------------------------------
2015-1030: update README + upload mana2.2 to PyPi !!!!
----------------------------------------------------
2015-1030: update mana init --> yes we can run!!!!


## powered by click
Expand Down
7 changes: 4 additions & 3 deletions mana/mana.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from templates._base import _init_py, _init_sql_py, _init_config_py
from templates._config import _config_sql_py, _config_py
from templates._sql import _sql_py
from templates._management import _management_py
from templates._management import _management_py, _manage_py
from templates._blueprint import _blueprint_py
from templates._deploy import _wsgi_py

Expand Down Expand Up @@ -121,8 +121,8 @@ def init(project_name, sql, config):

if config:
os.system("touch %s/config.py" % project_name)
os.system("touch %s/README.md %s/requirement.txt" \
% make_tuple(project_name, 2))
os.system("touch %s/README.md %s/requirement.txt %s/manage.py" \
% make_tuple(project_name, 3))
os.system("mkdir %s/app/ %s/test/" \
% make_tuple(project_name, 2))

Expand All @@ -149,6 +149,7 @@ def init(project_name, sql, config):
os.system("mana manage %s" % project_name)
else:
fill_file_w(project_name, 'app/__init__.py', _init_py)
fill_file_w(project_name, 'manage.py', _manage_py)

click.echo("init ... done!🍺 ")

Expand Down
9 changes: 9 additions & 0 deletions mana/templates/_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,12 @@ def test():
app.debug = True
manager.run()
'''

_manage_py = '''# coding: utf-8
from app import app
if __name__ == "__main__":
app.run(debug=True)
'''
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name='mana',
version='2.2',
version='2.3',
packages=find_packages(),
url='https://github.com/neo1218/mana',
license='MIT',
Expand Down

0 comments on commit 84e9112

Please sign in to comment.