Skip to content

Commit 3d9353a

Browse files
author
Anand Suresh
committed
pre-final commit
1 parent 2c2d5ce commit 3d9353a

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

Diff for: __pycache__/c2p.cpython-37.pyc

3.67 KB
Binary file not shown.

Diff for: __pycache__/ptp.cpython-37.pyc

3.14 KB
Binary file not shown.

Diff for: php_tc.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
n= input()
2+
print('hey')

Diff for: run.py

+18-10
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,24 @@ def transform_view():
3535
result = transform(file_contents)
3636

3737
print(result)
38-
py_list = c2p.convert(result)
39-
pycode=''
40-
for i in py_list:
41-
print(i,end='')
42-
pycode+=i
43-
#print(pycode)
44-
response = make_response(pycode)
45-
response.headers["Content-Disposition"] = "attachment; filename=converted_py_code.py"
46-
time.sleep(0.8)
47-
return response
38+
if '#incude' in result:
39+
py_list = c2p.convert(result)
40+
pycode=''
41+
for i in py_list:
42+
print(i,end='')
43+
pycode+=i
44+
#print(pycode)
45+
response = make_response(pycode)
46+
response.headers["Content-Disposition"] = "attachment; filename=converted_py_code.py"
47+
time.sleep(0.8)
48+
return response
49+
else:
50+
php_code = ptp.convert(result+'\n')
51+
response = make_response(php_code)
52+
response.headers["Content-Disposition"] = "attachment; filename=converted_php_code.php"
53+
time.sleep(0.8)
54+
return response
55+
4856

4957
@app.route('/box', methods=['POST','GET'])
5058
def box():

0 commit comments

Comments
 (0)