* Replaced Python 2 print syntax with Python 3 syntax * Update utils.pyversion-14
@@ -1,7 +1,7 @@ | |||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
from __future__ import unicode_literals, print_function | |||||
import frappe | import frappe | ||||
from frappe.model.document import Document | from frappe.model.document import Document | ||||
from frappe.utils import cint, has_gravatar, format_datetime, now_datetime, get_formatted_email | from frappe.utils import cint, has_gravatar, format_datetime, now_datetime, get_formatted_email | ||||
@@ -191,7 +191,7 @@ class User(Document): | |||||
self.email_new_password(new_password) | self.email_new_password(new_password) | ||||
except frappe.OutgoingEmailError: | except frappe.OutgoingEmailError: | ||||
print frappe.get_traceback() | |||||
print(frappe.get_traceback()) | |||||
pass # email server not set, don't send email | pass # email server not set, don't send email | ||||
@Document.hook | @Document.hook | ||||
@@ -1,7 +1,7 @@ | |||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
from __future__ import unicode_literals, print_function | |||||
import frappe | import frappe | ||||
import os | import os | ||||
@@ -25,7 +25,7 @@ def execute(): | |||||
_file_name, content = get_file(name) | _file_name, content = get_file(name) | ||||
b.content_hash = get_content_hash(content) | b.content_hash = get_content_hash(content) | ||||
except IOError: | except IOError: | ||||
print 'Warning: Error processing ', name | |||||
print('Warning: Error processing ', name) | |||||
_file_name = old_file_name | _file_name = old_file_name | ||||
b.content_hash = None | b.content_hash = None | ||||
@@ -7,6 +7,7 @@ sUpdate source and target apps below and run from CLI | |||||
''' | ''' | ||||
from __future__ import print_function | |||||
import frappe, re, os | import frappe, re, os | ||||
source = frappe.get_app_path('frappe_theme', 'public', 'less', 'frappe_theme.less') | source = frappe.get_app_path('frappe_theme', 'public', 'less', 'frappe_theme.less') | ||||
@@ -39,4 +40,4 @@ def purifycss(): | |||||
classes.remove(c) | classes.remove(c) | ||||
for c in sorted(classes): | for c in sorted(classes): | ||||
print c | |||||
print(c) |
@@ -302,7 +302,6 @@ def add_missing_headers(): | |||||
else: | else: | ||||
fname = fname[:-3] | fname = fname[:-3] | ||||
h = fname.replace('_', ' ').replace('-', ' ').title() | h = fname.replace('_', ' ').replace('-', ' ').title() | ||||
print h | |||||
content = '# {0}\n\n'.format(h) + content | content = '# {0}\n\n'.format(h) + content | ||||
f.write(content.encode('utf-8')) | f.write(content.encode('utf-8')) | ||||
@@ -1,7 +1,7 @@ | |||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
from __future__ import unicode_literals, print_function | |||||
no_sitemap = 1 | no_sitemap = 1 | ||||
no_cache = 1 | no_cache = 1 | ||||
@@ -23,7 +23,7 @@ def get_context(context): | |||||
boot = frappe.sessions.get() | boot = frappe.sessions.get() | ||||
except Exception as e: | except Exception as e: | ||||
boot = frappe._dict(status='failed', error = str(e)) | boot = frappe._dict(status='failed', error = str(e)) | ||||
print frappe.get_traceback() | |||||
print(frappe.get_traceback()) | |||||
# this needs commit | # this needs commit | ||||
csrf_token = frappe.sessions.get_csrf_token() | csrf_token = frappe.sessions.get_csrf_token() | ||||