web2py.py -G config, will make GAE config easier
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.9.5-trunk+timestamp.2014.03.29.17.27.37
|
Version 2.9.5-trunk+timestamp.2014.03.29.17.42.51
|
||||||
|
|||||||
@@ -618,6 +618,12 @@ def console():
|
|||||||
type='int',
|
type='int',
|
||||||
help='port of server (8000)')
|
help='port of server (8000)')
|
||||||
|
|
||||||
|
parser.add_option('-G',
|
||||||
|
'--GAE',
|
||||||
|
default=None,
|
||||||
|
dest='gae',
|
||||||
|
help="'-G configure' will create app.yaml and gaehandler.py")
|
||||||
|
|
||||||
msg = ('password to be used for administration '
|
msg = ('password to be used for administration '
|
||||||
'(use -a "<recycle>" to reuse the last password))')
|
'(use -a "<recycle>" to reuse the last password))')
|
||||||
parser.add_option('-a',
|
parser.add_option('-a',
|
||||||
@@ -923,6 +929,20 @@ def console():
|
|||||||
global_settings.cmd_options = options
|
global_settings.cmd_options = options
|
||||||
global_settings.cmd_args = args
|
global_settings.cmd_args = args
|
||||||
|
|
||||||
|
if options.gae:
|
||||||
|
if not os.path.exists('app.yaml'):
|
||||||
|
name = raw_input("Your GAE app name: ")
|
||||||
|
content = open(os.path.join('examples','app.example.yaml'),'rb').read()
|
||||||
|
open('app.yaml','wb').write(content.replace("yourappname",name))
|
||||||
|
else:
|
||||||
|
print "app.yaml alreday exists in the web2py folder"
|
||||||
|
if not os.path.exists('gaehandler.py'):
|
||||||
|
content = open(os.path.join('handlers','gaehandler.py'),'rb').read()
|
||||||
|
open('gaehandler.py','wb').write(content)
|
||||||
|
else:
|
||||||
|
print "gaehandler.py alreday exists in the web2py folder"
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
options.ips = list(set( # no duplicates
|
options.ips = list(set( # no duplicates
|
||||||
[addrinfo[4][0] for addrinfo in getipaddrinfo(socket.getfqdn())
|
[addrinfo[4][0] for addrinfo in getipaddrinfo(socket.getfqdn())
|
||||||
|
|||||||
Reference in New Issue
Block a user