Skip to content

Commit b4cd164

Browse files
committed
Run futurize --stage1
Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 474f561 commit b4cd164

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed

check_dns.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def check_dns():
3535
sitestatus = wordpress
3636
else:
3737
sitestatus = "Your site appears to be working properly. Have fun!"
38-
except urllib2.HTTPError,e:
38+
except urllib2.HTTPError as e:
3939
if 'wp-login' in e.geturl():
4040
sitestatus = wordpress
4141
elif e.code == 404:

scripts/log.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ def exceptions(func,*args,**kw):
5353
raise
5454
except ExpectedException:
5555
raise
56-
except Exception,e:
56+
except Exception as e:
5757
if not getattr(e,'already_syslogged',False):
5858
from .auth import current_user
5959
argness = ', '.join(repr(a) for a in args)
6060
if len(args) > 0 and len(kw) > 0:
6161
argness += ', '
6262
argness += ', '.join('%s=%s'%(k,repr(kw[k])) for k in kw)
6363
err("%s called %s(%s) but got: %s"
64-
% (current_user(),func.func_name,argness,e))
64+
% (current_user(),func.__name__,argness,e))
6565
e.already_syslogged = True
6666
raise
6767

scriptspony/controllers/root.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def index(self,locker=None,sudo=False):
7878
try:
7979
hosts = vhosts.list_vhosts(locker)
8080
hosts.sort(key=lambda k:k[0])
81-
except auth.AuthError,e:
81+
except auth.AuthError as e:
8282
flash(e.message)
8383
# User has been deauthorized from this locker
8484
if locker in user_info.lockers:
@@ -108,7 +108,7 @@ def edit(self,locker,hostname,path=None,token=None,alias=''):
108108
else:
109109
try:
110110
vhosts.set_path(locker,hostname,path)
111-
except vhosts.UserError,e:
111+
except vhosts.UserError as e:
112112
flash(e.message)
113113
else:
114114
flash("Host '%s' reconfigured."%hostname)
@@ -121,15 +121,15 @@ def edit(self,locker,hostname,path=None,token=None,alias=''):
121121
else:
122122
try:
123123
vhosts.add_alias(locker,hostname,alias)
124-
except vhosts.UserError,e:
124+
except vhosts.UserError as e:
125125
flash(e.message)
126126
else:
127127
flash("Alias '%s' added to hostname '%s'."
128128
% (alias,hostname))
129129
redirect('/index/'+locker)
130130
try:
131131
path,aliases=vhosts.get_vhost_info(locker,hostname)
132-
except vhosts.UserError,e:
132+
except vhosts.UserError as e:
133133
flash(e.message)
134134
redirect('/index/'+locker)
135135
return dict(locker=locker, hostname=hostname,
@@ -145,7 +145,7 @@ def delete(self,locker,hostname,confirm=False,token=None):
145145
else:
146146
try:
147147
vhosts.delete(locker,hostname)
148-
except vhosts.UserError,e:
148+
except vhosts.UserError as e:
149149
flash(e.message)
150150
else:
151151
flash("Host '%s' deleted."%hostname)
@@ -154,7 +154,7 @@ def delete(self,locker,hostname,confirm=False,token=None):
154154
else:
155155
try:
156156
path,aliases=vhosts.get_vhost_info(locker,hostname)
157-
except vhosts.UserError,e:
157+
except vhosts.UserError as e:
158158
flash(e.message)
159159
redirect('/index/'+locker)
160160
return dict(locker=locker, hostname=hostname,
@@ -184,7 +184,7 @@ def new(self,locker,hostname='',path='',desc='',token=None,
184184
status = vhosts.request_vhost(locker,hostname,path,
185185
user=requestor,
186186
desc=desc)
187-
except vhosts.UserError,e:
187+
except vhosts.UserError as e:
188188
flash(e.message)
189189
else:
190190
flash(status)
@@ -195,7 +195,7 @@ def new(self,locker,hostname='',path='',desc='',token=None,
195195
else:
196196
try:
197197
auth.validate_locker(locker,sudo_ok=True)
198-
except auth.AuthError,e:
198+
except auth.AuthError as e:
199199
flash(e.message)
200200
redirect('/')
201201

@@ -235,7 +235,7 @@ def approve(self,id,subject=None,body=None,token=None,silent=False):
235235
else:
236236
try:
237237
vhosts.actually_create_vhost(t.locker,t.hostname,t.path)
238-
except vhosts.UserError,e:
238+
except vhosts.UserError as e:
239239
flash(e.message)
240240
else:
241241
if not silent:

scriptspony/model/__init__.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""The application's model objects"""
3+
from __future__ import absolute_import
34

45
from zope.sqlalchemy import ZopeTransactionExtension
56
from sqlalchemy.orm import scoped_session, sessionmaker
@@ -64,6 +65,6 @@ def init_model(engine):
6465
elixir.metadata, elixir.session = metadata, DBSession
6566

6667
# Import your model modules here.
67-
import user
68-
import queue
68+
from . import user
69+
from . import queue
6970
from scripts.model import meta

scriptspony/websetup.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""Setup the ScriptsPony application"""
3+
from __future__ import print_function
34

45
import logging
56

@@ -18,9 +19,9 @@ def setup_app(command, conf, vars):
1819
load_environment(conf.global_conf, conf.local_conf)
1920
# Load the models
2021
from scriptspony import model
21-
print "Creating tables"
22+
print("Creating tables")
2223
#model.metadata.drop_all(bind=config['tg.app_globals'].sa_engine)
2324
model.metadata.create_all(bind=config['tg.app_globals'].sa_engine)
2425

2526
transaction.commit()
26-
print "Successfully setup"
27+
print("Successfully setup")

0 commit comments

Comments
 (0)