[fix] Added unicode_literals if missing in py filesversion-14
@@ -1 +1,2 @@ | |||||
from __future__ import unicode_literals | |||||
__version__ = "4.12.1" | __version__ = "4.12.1" |
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
import json | import json | ||||
import frappe | import frappe | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
import sys, os | import sys, os | ||||
import json | import json | ||||
@@ -1,3 +1,4 @@ | |||||
from __future__ import unicode_literals | |||||
from frappe import _ | from frappe import _ | ||||
def get_data(): | def get_data(): | ||||
@@ -1,3 +1,4 @@ | |||||
from __future__ import unicode_literals | |||||
from frappe import _ | from frappe import _ | ||||
from frappe.widgets.moduleview import add_setup_section | from frappe.widgets.moduleview import add_setup_section | ||||
@@ -1,3 +1,4 @@ | |||||
from __future__ import unicode_literals | |||||
from frappe import _ | from frappe import _ | ||||
def get_data(): | def get_data(): | ||||
@@ -4,13 +4,12 @@ | |||||
from __future__ import unicode_literals | from __future__ import unicode_literals | ||||
import frappe | import frappe | ||||
import json | import json | ||||
import urllib | |||||
from email.utils import formataddr | from email.utils import formataddr | ||||
from frappe.website.utils import is_signup_enabled | from frappe.website.utils import is_signup_enabled | ||||
from frappe.utils import get_url, cstr | from frappe.utils import get_url, cstr | ||||
from frappe.utils.email_lib.email_body import get_email | from frappe.utils.email_lib.email_body import get_email | ||||
from frappe.utils.email_lib.smtp import send | from frappe.utils.email_lib.smtp import send | ||||
from frappe.utils import scrub_urls, cint | |||||
from frappe.utils import scrub_urls, cint, quoted | |||||
from frappe import _ | from frappe import _ | ||||
from frappe.model.document import Document | from frappe.model.document import Document | ||||
@@ -167,14 +166,13 @@ def attach_print(mail, sent_via, print_html, print_format): | |||||
def set_portal_link(sent_via, comm): | def set_portal_link(sent_via, comm): | ||||
"""set portal link in footer""" | """set portal link in footer""" | ||||
footer = "" | footer = "" | ||||
if is_signup_enabled(): | if is_signup_enabled(): | ||||
is_valid_recipient = cstr(sent_via.get("email") or sent_via.get("email_id") or | is_valid_recipient = cstr(sent_via.get("email") or sent_via.get("email_id") or | ||||
sent_via.get("contact_email")) in comm.recipients | sent_via.get("contact_email")) in comm.recipients | ||||
if is_valid_recipient: | if is_valid_recipient: | ||||
url = "%s/%s/%s" % (get_url(), urllib.quote(sent_via.doctype), urllib.quote(sent_via.name)) | |||||
url = quoted("%s/%s/%s" % (get_url(), sent_via.doctype, sent_via.name)) | |||||
footer = """<!-- Portal Link --> | footer = """<!-- Portal Link --> | ||||
<p><a href="%s" target="_blank">View this on our website</a></p>""" % url | <p><a href="%s" target="_blank">View this on our website</a></p>""" % url | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# See license.txt | # See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
import unittest | import unittest | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, {app_publisher} and Contributors | # Copyright (c) 2013, {app_publisher} and Contributors | ||||
# See license.txt | # See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
import unittest | import unittest | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# See license.txt | # See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe, frappe.utils, frappe.utils.scheduler | import frappe, frappe.utils, frappe.utils.scheduler | ||||
import unittest | import unittest | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
"""Use blog post test to test user permissions logic""" | """Use blog post test to test user permissions logic""" | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# See license.txt | # See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
import unittest | import unittest | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# See license.txt | # See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
import unittest | import unittest | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe, unittest | import frappe, unittest | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# See license.txt | # See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
import unittest | import unittest | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
import frappe.defaults | import frappe.defaults | ||||
@@ -1,3 +1,4 @@ | |||||
from __future__ import unicode_literals | |||||
app_name = "frappe" | app_name = "frappe" | ||||
app_title = "Frappe Framework" | app_title = "Frappe Framework" | ||||
app_publisher = "Web Notes Technologies Pvt. Ltd." | app_publisher = "Web Notes Technologies Pvt. Ltd." | ||||
@@ -24,7 +24,7 @@ type_map = { | |||||
,'Small Text': ('text', '') | ,'Small Text': ('text', '') | ||||
,'Long Text': ('longtext', '') | ,'Long Text': ('longtext', '') | ||||
,'Code': ('text', '') | ,'Code': ('text', '') | ||||
,'Text Editor': ('text', '') | |||||
,'Text Editor': ('longtext', '') | |||||
,'Date': ('date', '') | ,'Date': ('date', '') | ||||
,'Datetime': ('datetime', '6') | ,'Datetime': ('datetime', '6') | ||||
,'Time': ('time', '6') | ,'Time': ('time', '6') | ||||
@@ -1,3 +1,4 @@ | |||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
def execute(): | def execute(): | ||||
@@ -1,3 +1,4 @@ | |||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
def execute(): | def execute(): | ||||
@@ -1,3 +1,4 @@ | |||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
from frappe.model import rename_field | from frappe.model import rename_field | ||||
@@ -1,3 +1,4 @@ | |||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
from frappe.model import rename_field | from frappe.model import rename_field | ||||
@@ -1,3 +1,4 @@ | |||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
def execute(): | def execute(): | ||||
@@ -1,3 +1,4 @@ | |||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
def execute(): | def execute(): | ||||
@@ -1,3 +1,4 @@ | |||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
def execute(): | def execute(): | ||||
@@ -1,3 +1,4 @@ | |||||
from __future__ import unicode_literals | |||||
import frappe, json | import frappe, json | ||||
def execute(): | def execute(): | ||||
@@ -1,3 +1,4 @@ | |||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
def execute(): | def execute(): | ||||
@@ -1,3 +1,4 @@ | |||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
def execute(): | def execute(): | ||||
@@ -1,3 +1,4 @@ | |||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
import logging | import logging | ||||
import logging.config | import logging.config | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
import frappe.utils, markdown2 | import frappe.utils, markdown2 | ||||
@@ -1,4 +1,5 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
no_sitemap = 1 | no_sitemap = 1 |
@@ -1,4 +1,5 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
no_sitemap = 1 | no_sitemap = 1 |
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2014, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2014, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe, unittest | import frappe, unittest | ||||
import frappe.widgets.form.assign_to | import frappe.widgets.form.assign_to | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
import unittest, frappe | import unittest, frappe | ||||
from frappe.utils import sel | from frappe.utils import sel | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2014, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2014, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe, unittest | import frappe, unittest | ||||
from frappe.core.page.data_import_tool import exporter | from frappe.core.page.data_import_tool import exporter | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe, unittest | import frappe, unittest | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe, unittest | import frappe, unittest | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe, unittest | import frappe, unittest | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
import os | import os | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
from frappe import _ | from frappe import _ | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe, unittest | import frappe, unittest | ||||
from frappe.widgets.form.meta import get_meta | from frappe.widgets.form.meta import get_meta | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
import unittest | import unittest | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe, unittest, os | import frappe, unittest, os | ||||
import frappe.translate | import frappe.translate | ||||
@@ -1,3 +1,4 @@ | |||||
from __future__ import unicode_literals | |||||
import click | import click | ||||
import frappe | import frappe | ||||
import importlib | import importlib | ||||
@@ -583,10 +583,13 @@ def expand_relative_urls(html): | |||||
return re.sub('(href|src){1}([\s]*=[\s]*[\'"]?)((?!http)[^\'" >]+)([\'"]?)', _expand_relative_urls, html) | return re.sub('(href|src){1}([\s]*=[\s]*[\'"]?)((?!http)[^\'" >]+)([\'"]?)', _expand_relative_urls, html) | ||||
def quoted(url): | |||||
return cstr(urllib.quote(encode(url), safe=b"~@#$&()*!+=:;,.?/'")) | |||||
def quote_urls(html): | def quote_urls(html): | ||||
def _quote_url(match): | def _quote_url(match): | ||||
groups = list(match.groups()) | groups = list(match.groups()) | ||||
groups[2] = urllib.quote(groups[2].encode("utf-8"), safe=b"~@#$&()*!+=:;,.?/'").decode("utf-8") | |||||
groups[2] = quoted(groups[2]) | |||||
return "".join(groups) | return "".join(groups) | ||||
return re.sub('(href|src){1}([\s]*=[\s]*[\'"]?)((?:http)[^\'">]+)([\'"]?)', | return re.sub('(href|src){1}([\s]*=[\s]*[\'"]?)((?:http)[^\'">]+)([\'"]?)', | ||||
_quote_url, html) | _quote_url, html) | ||||
@@ -1,3 +1,4 @@ | |||||
from __future__ import unicode_literals | |||||
import json, base64, os | import json, base64, os | ||||
import frappe.cli | import frappe.cli | ||||
from frappe.celery_app import get_celery | from frappe.celery_app import get_celery | ||||
@@ -1,5 +1,6 @@ | |||||
#!/usr/bin/env python | #!/usr/bin/env python | ||||
"""html2text: Turn HTML into equivalent Markdown-structured text.""" | """html2text: Turn HTML into equivalent Markdown-structured text.""" | ||||
from __future__ import unicode_literals | |||||
__version__ = "3.200.3" | __version__ = "3.200.3" | ||||
__author__ = "Aaron Swartz (me@aaronsw.com)" | __author__ = "Aaron Swartz (me@aaronsw.com)" | ||||
__copyright__ = "(C) 2004-2008 Aaron Swartz. GNU GPL 3." | __copyright__ = "(C) 2004-2008 Aaron Swartz. GNU GPL 3." | ||||
@@ -27,6 +27,7 @@ | |||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||||
# SOFTWARE. | # SOFTWARE. | ||||
# */ | # */ | ||||
from __future__ import unicode_literals | |||||
from StringIO import StringIO | from StringIO import StringIO | ||||
@@ -1,4 +1,5 @@ | |||||
# get data for moment.js | # get data for moment.js | ||||
from __future__ import unicode_literals | |||||
def update(tz, out): | def update(tz, out): | ||||
ltz = data["links"].get(tz, tz) | ltz = data["links"].get(tz, tz) | ||||
zone = data["zones"].get(ltz) | zone = data["zones"].get(ltz) | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
import pdfkit, os, frappe | import pdfkit, os, frappe | ||||
from frappe.utils import scrub_urls | from frappe.utils import scrub_urls | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
"""Use blog post test to test user permissions logic""" | """Use blog post test to test user permissions logic""" | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# MIT License. See license.txt | # MIT License. See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe | import frappe |
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# See license.txt | # See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
import unittest | import unittest | ||||
@@ -1,5 +1,6 @@ | |||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors | ||||
# See license.txt | # See license.txt | ||||
from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
import unittest | import unittest | ||||