Mercurial > hg > wsgintegrate
changeset 29:d742aff49859
-> python3
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sun, 10 May 2020 18:46:40 -0700 |
parents | b3a950065844 |
children | 1ad7f99f588d |
files | setup.py tox.ini wsgintegrate/dispatcher.py wsgintegrate/factory.py wsgintegrate/main.py |
diffstat | 5 files changed, 11 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/setup.py Sun May 10 18:39:21 2020 -0700 +++ b/setup.py Sun May 10 18:46:40 2020 -0700 @@ -10,7 +10,7 @@ except: description = '' -dependencies = ['webob', 'pyloader'] +dependencies = ['webob', 'pyloader>=0.1.5'] setup(name='wsgintegrate', version=version,
--- a/tox.ini Sun May 10 18:39:21 2020 -0700 +++ b/tox.ini Sun May 10 18:46:40 2020 -0700 @@ -1,7 +1,6 @@ # https://tox.readthedocs.io/en/latest/ - [tox] -envlist=py27 +envlist=py27,py37 [testenv] commands=python setup.py test \ No newline at end of file
--- a/wsgintegrate/dispatcher.py Sun May 10 18:39:21 2020 -0700 +++ b/wsgintegrate/dispatcher.py Sun May 10 18:46:40 2020 -0700 @@ -22,7 +22,7 @@ except exc.HTTPNotFound: continue except: - print app + print(app) raise else: response = exc.HTTPNotFound()
--- a/wsgintegrate/factory.py Sun May 10 18:39:21 2020 -0700 +++ b/wsgintegrate/factory.py Sun May 10 18:46:40 2020 -0700 @@ -18,12 +18,12 @@ # reload the .ini file mtime = os.path.getmtime(self.inifile) if mtime > self.mtime: - print "Reloading '%s': %s > %s" % (self.inifile, mtime, self.mtime) + print("Reloading '%s': %s > %s" % (self.inifile, mtime, self.mtime)) try: config = self.read(self.inifile) self.configure(config) - except Exception, e: - print >> sys.stderr, "Error reading '%s': %s" % (self.inifile, e) + except Exception as e: + sys.stderr.write("Error reading '%s': %s\n" % (self.inifile, e)) self.mtime = mtime app = self.load(self.main)
--- a/wsgintegrate/main.py Sun May 10 18:39:21 2020 -0700 +++ b/wsgintegrate/main.py Sun May 10 18:46:40 2020 -0700 @@ -50,20 +50,20 @@ # print configuration, if specified if options.list_apps: for app in sorted(factory.config.keys()): - print app + print(app) return if options.print_json: - print factory.json_config() + print(factory.json_config()) return if options.print_ini: - print factory.ini_config() + print(factory.ini_config()) return # serve it server_name = getattr(options, 'server', 'wsgiref') - print ("Serving with %s" % (server_name)) + print("Serving with %s" % (server_name)) server = servers[server_name] - print ('http://localhost:%d/' % options.port) + print('http://localhost:%d/' % options.port) server(app=factory.load(), port=options.port) if __name__ == '__main__':