Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 6bddc19

Browse files
committed
convert to py3 CodeLens broken
1 parent 44b6748 commit 6bddc19

File tree

19 files changed

+721
-213
lines changed

19 files changed

+721
-213
lines changed

runestone/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ def runestone_extensions():
2929
basedir = os.path.dirname(__file__)
3030
module_paths = [ x for x in os.listdir(basedir) if os.path.isdir(os.path.join(basedir,x))]
3131
modules = [ 'runestone.{}'.format(x) for x in module_paths if os.path.exists('{}/__init__.py'.format(os.path.join(basedir,x)))]
32-
print "MODULES = ", modules
32+
print("MODULES = ", modules)
3333
return modules

runestone/__main__.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ def init():
1212
paver_stuff = resource_string('runestone','common/newproject_template/pavement.py')
1313
conf_dict = {}
1414
print("This will create a new Runestone project in your current directory.")
15-
proceed = raw_input("Do you want to proceed? Y/n") or "Y"
15+
proceed = eval(input("Do you want to proceed? Y/n")) or "Y"
1616
if proceed[0].lower() == "n":
1717
sys.exit(0)
1818
print("Next we need to gather a few pieces of information to create your configuration files")
19-
conf_dict['project_name'] = raw_input("Project name: (one word, no spaces)")
20-
conf_dict['build_dir'] = raw_input("path to build dir [./build] ") or "build"
21-
conf_dict['login_req'] = raw_input("require login [false] ") or "false"
22-
conf_dict['master_url'] = raw_input("URL for ajax server [http://127.0.0.1:8000] ") or "http://127.0.0.1:8000"
23-
conf_dict['author'] = raw_input("your Name ") or getpass.getuser()
24-
conf_dict['project_title'] = raw_input("Title for this project [Runestone Default]") or "Runestone Default"
19+
conf_dict['project_name'] = eval(input("Project name: (one word, no spaces)"))
20+
conf_dict['build_dir'] = eval(input("path to build dir [./build] ")) or "build"
21+
conf_dict['login_req'] = eval(input("require login [false] ")) or "false"
22+
conf_dict['master_url'] = eval(input("URL for ajax server [http://127.0.0.1:8000] ")) or "http://127.0.0.1:8000"
23+
conf_dict['author'] = eval(input("your Name ")) or getpass.getuser()
24+
conf_dict['project_title'] = eval(input("Title for this project [Runestone Default]")) or "Runestone Default"
2525

2626
shutil.copytree(os.path.join(template_base_dir,'_sources'),'_sources')
2727
shutil.copytree(os.path.join(template_base_dir,'_static'),'_static')
@@ -44,8 +44,8 @@ def build():
4444
paver_main()
4545

4646
def serve():
47-
import SimpleHTTPServer
48-
import SocketServer
47+
import http.server
48+
import socketserver
4949
sys.path.insert(0,os.getcwd())
5050
try:
5151
import pavement
@@ -56,9 +56,9 @@ def serve():
5656
os.chdir(pavement.serving_dir)
5757

5858
PORT = 8000
59-
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
60-
httpd = SocketServer.TCPServer(("", PORT), Handler)
61-
print "serving at port", PORT
59+
Handler = http.server.SimpleHTTPRequestHandler
60+
httpd = socketserver.TCPServer(("", PORT), Handler)
61+
print(("serving at port", PORT))
6262

6363
httpd.serve_forever()
6464

runestone/activecode/activecode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ def run(self):
331331

332332
complete=""
333333
no_of_buttons=0
334-
okeys = self.options.keys()
334+
okeys = list(self.options.keys())
335335
for k in okeys:
336336
if '_' in k:
337337
x,label = k.split('_')

runestone/animation/animation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,4 @@ def run(self):
102102
'initial_header_level': 2},
103103
writer_name="html")
104104

105-
print doc_parts['html_body']
105+
print(doc_parts['html_body'])

0 commit comments

Comments
 (0)