##// END OF EJS Templates
cli: convert 'gearbox install-iis' into 'kallithea-cli iis-install'
Thomas De Schampheleire -
r7334:9de61c5b default
parent child Browse files
Show More
@@ -59,7 +59,7 b' ISAPI handler'
59
59
60 The ISAPI handler can be generated using::
60 The ISAPI handler can be generated using::
61
61
62 gearbox install-iis -c my.ini --virtualdir=/
62 kallithea-cli iis-install -c my.ini --virtualdir=/
63
63
64 This will generate a ``dispatch.py`` file in the current directory that contains
64 This will generate a ``dispatch.py`` file in the current directory that contains
65 the necessary components to finalize an installation into IIS. Once this file
65 the necessary components to finalize an installation into IIS. Once this file
@@ -17,5 +17,6 b' from kallithea.bin.kallithea_cli_base im'
17
17
18 # import commands (they will add themselves to the 'cli' object)
18 # import commands (they will add themselves to the 'cli' object)
19 import kallithea.bin.kallithea_cli_config
19 import kallithea.bin.kallithea_cli_config
20 import kallithea.bin.kallithea_cli_iis
20 import kallithea.bin.kallithea_cli_ishell
21 import kallithea.bin.kallithea_cli_ishell
21 import kallithea.bin.kallithea_cli_repo
22 import kallithea.bin.kallithea_cli_repo
@@ -11,21 +11,15 b''
11 #
11 #
12 # You should have received a copy of the GNU General Public License
12 # You should have received a copy of the GNU General Public License
13 # along with this program. If not, see <http://www.gnu.org/licenses/>.
13 # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 """
14 import click
15 kallithea.lib.paster_commands.install_iis
15 import kallithea
16 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 import kallithea.bin.kallithea_cli_base as cli_base
17
18 IIS installation tools for Kallithea
19 """
20
21
17
22 import os
18 import os
23
19 import sys
24 from kallithea.lib.paster_commands.common import BasePasterCommand
25
26
20
27 dispath_py_template = '''\
21 dispath_py_template = '''\
28 # Created by Kallithea 'gearbox install-iis'
22 # Created by Kallithea 'kallithea-cli iis-install'
29 import sys
23 import sys
30
24
31 if hasattr(sys, "isapidllhandle"):
25 if hasattr(sys, "isapidllhandle"):
@@ -60,38 +54,28 b" if __name__=='__main__':"
60 HandleCommandLine(params)
54 HandleCommandLine(params)
61 '''
55 '''
62
56
63
57 @cli_base.register_command(config_file=True)
64 class Command(BasePasterCommand):
58 @click.option('--virtualdir', default='/',
65 '''Kallithea: Install into IIS using isapi-wsgi'''
59 help='The virtual folder to install into on IIS.')
66
60 def iis_install(virtualdir):
67 requires_db_session = False
61 """Install into IIS using isapi-wsgi."""
68
62
69 def take_action(self, args):
63 config_file_abs = kallithea.CONFIG['__file__']
70 config_file = os.path.abspath(args.config_file)
71 try:
72 import isapi_wsgi
73 except ImportError:
74 self.error('missing requirement: isapi-wsgi not installed')
75
64
76 dispatchfile = os.path.join(os.getcwd(), 'dispatch.py')
65 try:
77 print 'Writing %s' % dispatchfile
66 import isapi_wsgi
78 with open(dispatchfile, 'w') as f:
67 except ImportError:
79 f.write(dispath_py_template % {
68 sys.stderr.write('missing requirement: isapi-wsgi not installed\n')
80 'inifile': config_file.replace('\\', '\\\\'),
69 sys.exit(1)
81 'virtualdir': args.virtualdir,
82 })
83
70
84 print ('Run \'python "%s" install\' with administrative privileges '
71 dispatchfile = os.path.join(os.getcwd(), 'dispatch.py')
85 'to generate the _dispatch.dll file and install it into the '
72 click.echo('Writing %s' % dispatchfile)
86 'default web site') % (dispatchfile,)
73 with open(dispatchfile, 'w') as f:
87
74 f.write(dispath_py_template % {
88 def get_parser(self, prog_name):
75 'inifile': config_file_abs.replace('\\', '\\\\'),
89 parser = super(Command, self).get_parser(prog_name)
76 'virtualdir': virtualdir,
77 })
90
78
91 parser.add_argument('--virtualdir',
79 click.echo('Run \'python "%s" install\' with administrative privileges '
92 action='store',
80 'to generate the _dispatch.dll file and install it into the '
93 dest='virtualdir',
81 'default web site' % dispatchfile)
94 default='/',
95 help='The virtual folder to install into on IIS')
96
97 return parser
@@ -160,7 +160,6 b' setuptools.setup('
160
160
161 [gearbox.commands]
161 [gearbox.commands]
162 celeryd=kallithea.lib.paster_commands.celeryd:Command
162 celeryd=kallithea.lib.paster_commands.celeryd:Command
163 install-iis=kallithea.lib.paster_commands.install_iis:Command
164 make-index=kallithea.lib.paster_commands.make_index:Command
163 make-index=kallithea.lib.paster_commands.make_index:Command
165 make-rcext=kallithea.lib.paster_commands.make_rcextensions:Command
164 make-rcext=kallithea.lib.paster_commands.make_rcextensions:Command
166 setup-db=kallithea.lib.paster_commands.setup_db:Command
165 setup-db=kallithea.lib.paster_commands.setup_db:Command
General Comments 0
You need to be logged in to leave comments. Login now