# HG changeset patch # User Denis Laxalde # Date 1552578814 -3600 # Node ID 8d3952d7124ddb404bf6e1cae296dd1ba8c8364c # Parent 4d68d20427dee4b6751a0f1f5511fec2a04f4782 Remove _handle_win32() method from "create" command class This method generates code in a file using etwist module that we are about to drop. diff -r 4d68d20427de -r 8d3952d7124d cubicweb/cwctl.py --- a/cubicweb/cwctl.py Fri Mar 15 12:12:23 2019 +0100 +++ b/cubicweb/cwctl.py Thu Mar 14 16:53:34 2019 +0100 @@ -26,7 +26,7 @@ import sys from warnings import warn, filterwarnings from os import remove, listdir, system, pathsep -from os.path import exists, join, isdir, dirname, abspath +from os.path import exists, join, isdir try: from os import kill, getpgid @@ -397,7 +397,6 @@ config.input_config(section, self.config.config_level) # write down configuration config.save() - self._handle_win32(config, appid) print('-> generated config %s' % config.main_config_file()) # handle i18n files structure # in the first cube given @@ -424,29 +423,6 @@ if not self.config.no_db_create: helper.postcreate(self.config.automatic, self.config.config_level) - def _handle_win32(self, config, appid): - if sys.platform != 'win32': - return - service_template = """ -import sys -import win32serviceutil -sys.path.insert(0, r"%(CWPATH)s") - -from cubicweb.etwist.service import CWService - -classdict = {'_svc_name_': 'cubicweb-%(APPID)s', - '_svc_display_name_': 'CubicWeb ' + '%(CNAME)s', - 'instance': '%(APPID)s'} -%(CNAME)sService = type('%(CNAME)sService', (CWService,), classdict) - -if __name__ == '__main__': - win32serviceutil.HandleCommandLine(%(CNAME)sService) -""" - open(join(config.apphome, 'win32svc.py'), 'wb').write( - service_template % {'APPID': appid, - 'CNAME': appid.capitalize(), - 'CWPATH': abspath(join(dirname(__file__), '..'))}) - class DeleteInstanceCommand(Command): """Delete an instance. Will remove instance's files and