Skip to content

Commit 8dac18e

Browse files
committed
flake8 whitespace fixes; remove unused import backends
1 parent 104d3ba commit 8dac18e

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

roundup/demo.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
# Path where demo instance files will be stored
2323
TRACKER_HOME = os.path.abspath('demo')
2424

25+
2526
def install_demo(home, backend, template):
2627
"""Install a demo tracker
2728
@@ -35,7 +36,7 @@ def install_demo(home, backend, template):
3536
3637
"""
3738

38-
from roundup import init, instance, password, backends
39+
from roundup import init, instance, password
3940

4041
# set up the config for this tracker
4142
config = configuration.CoreConfig()
@@ -78,7 +79,7 @@ def install_demo(home, backend, template):
7879
# pick a fairly odd, random port
7980
port = 8917
8081
while 1:
81-
print('Trying to set up web server on port %d ...'%port,)
82+
print('Trying to set up web server on port %d ...' % port,)
8283
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
8384
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
8485
try:
@@ -92,7 +93,7 @@ def install_demo(home, backend, template):
9293
s.close()
9394
print('already in use.')
9495
port += 100
95-
config['TRACKER_WEB'] = 'http://%s:%s/demo/'%(hostname, port)
96+
config['TRACKER_WEB'] = 'http://%s:%s/demo/' % (hostname, port)
9697

9798
# write the config
9899
config['INSTANT_REGISTRATION'] = 1
@@ -110,7 +111,8 @@ def install_demo(home, backend, template):
110111

111112
# add the "demo" user
112113
db = tracker.open('admin')
113-
# FIXME: Move tracker-specific demo initialization into the tracker templates.
114+
# FIXME: Move tracker-specific demo initialization into the tracker
115+
# templates.
114116
if template == 'minimal':
115117
db.user.create(username='demo', password=password.Password('demo'),
116118
roles='User')
@@ -120,6 +122,7 @@ def install_demo(home, backend, template):
120122
db.commit()
121123
db.close()
122124

125+
123126
def run_demo(home):
124127
"""Run the demo tracker instance from its ``home`` directory"""
125128
print("Demo Tracker Home:", home)
@@ -148,7 +151,7 @@ def run_demo(home):
148151
roundup_server.run(success_message=success_message)
149152

150153

151-
def usage(msg = ''):
154+
def usage(msg=''):
152155
if msg:
153156
print(msg)
154157
print("""\
@@ -179,7 +182,7 @@ def main():
179182
except getopt.GetoptError as e:
180183
usage(str(e))
181184
return 1
182-
for opt, arg in opts:
185+
for opt, _arg in opts:
183186
if opt == '-h':
184187
usage()
185188
return 0

0 commit comments

Comments
 (0)