Sfoglia il codice sorgente

Merge pull request #1028 from anandpdoshi/anand-feb-24

[fix] Added unicode_literals if missing in py files
version-14
Anand Doshi 10 anni fa
parent
commit
85522e7077
58 ha cambiato i file con 62 aggiunte e 6 eliminazioni
  1. +1
    -0
      frappe/__version__.py
  2. +1
    -0
      frappe/api.py
  3. +1
    -0
      frappe/app.py
  4. +1
    -0
      frappe/config/desktop.py
  5. +1
    -0
      frappe/config/setup.py
  6. +1
    -0
      frappe/config/website.py
  7. +2
    -4
      frappe/core/doctype/communication/communication.py
  8. +1
    -0
      frappe/core/doctype/communication/test_communication.py
  9. +1
    -0
      frappe/core/doctype/doctype/boilerplate/test_controller.py
  10. +1
    -0
      frappe/core/doctype/email_alert/test_email_alert.py
  11. +1
    -0
      frappe/core/doctype/event/test_event.py
  12. +1
    -0
      frappe/core/doctype/letter_head/test_letter_head.py
  13. +1
    -0
      frappe/core/doctype/page/test_page.py
  14. +1
    -0
      frappe/core/doctype/print_format/test_print_format.py
  15. +1
    -0
      frappe/core/doctype/role/test_role.py
  16. +1
    -0
      frappe/core/doctype/user/test_user.py
  17. +1
    -0
      frappe/core/doctype/version/test_version.py
  18. +1
    -0
      frappe/core/doctype/workflow_state/test_workflow_state.py
  19. +1
    -0
      frappe/core/page/data_import_tool/test_exporter_fixtures.py
  20. +1
    -0
      frappe/hooks.py
  21. +1
    -1
      frappe/model/db_schema.py
  22. +1
    -0
      frappe/patches/v4_0/add_delete_permission.py
  23. +1
    -0
      frappe/patches/v4_0/remove_index_sitemap.py
  24. +1
    -0
      frappe/patches/v4_0/rename_profile_to_user.py
  25. +1
    -0
      frappe/patches/v4_0/rename_sitemap_to_route.py
  26. +1
    -0
      frappe/patches/v4_0/set_todo_checked_as_closed.py
  27. +1
    -0
      frappe/patches/v4_0/set_website_route_idx.py
  28. +1
    -0
      frappe/patches/v4_0/update_datetime.py
  29. +1
    -0
      frappe/patches/v4_0/webnotes_to_frappe.py
  30. +1
    -0
      frappe/patches/v4_2/refactor_website_routing.py
  31. +1
    -0
      frappe/patches/v4_2/set_assign_in_doc.py
  32. +1
    -0
      frappe/setup_logging.py
  33. +1
    -0
      frappe/templates/includes/comments.py
  34. +1
    -0
      frappe/templates/pages/404.py
  35. +1
    -0
      frappe/templates/pages/update_password.py
  36. +1
    -0
      frappe/tests/test_assign.py
  37. +1
    -0
      frappe/tests/test_client_login.py
  38. +1
    -0
      frappe/tests/test_data_import.py
  39. +1
    -0
      frappe/tests/test_db_query.py
  40. +1
    -0
      frappe/tests/test_defaults.py
  41. +1
    -0
      frappe/tests/test_document.py
  42. +1
    -0
      frappe/tests/test_filemanager.py
  43. +1
    -0
      frappe/tests/test_fmt_money.py
  44. +1
    -0
      frappe/tests/test_form_load.py
  45. +1
    -0
      frappe/tests/test_geo_ip.py
  46. +1
    -0
      frappe/tests/test_translation.py
  47. +1
    -0
      frappe/utils/bench_helper.py
  48. +4
    -1
      frappe/utils/data.py
  49. +1
    -0
      frappe/utils/doctor.py
  50. +1
    -0
      frappe/utils/email_lib/html2text.py
  51. +1
    -0
      frappe/utils/minify.py
  52. +1
    -0
      frappe/utils/momentjs.py
  53. +1
    -0
      frappe/utils/pdf.py
  54. +1
    -0
      frappe/website/doctype/blog_category/test_blog_category.py
  55. +1
    -0
      frappe/website/doctype/blog_post/test_blog_post.py
  56. +1
    -0
      frappe/website/doctype/blogger/test_blogger.py
  57. +1
    -0
      frappe/website/doctype/web_form/test_web_form.py
  58. +1
    -0
      frappe/website/doctype/website_group/test_website_group.py

+ 1
- 0
frappe/__version__.py Vedi File

@@ -1 +1,2 @@
from __future__ import unicode_literals
__version__ = "4.12.1"

+ 1
- 0
frappe/api.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

import json
import frappe


+ 1
- 0
frappe/app.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

import sys, os
import json


+ 1
- 0
frappe/config/desktop.py Vedi File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
from frappe import _

def get_data():


+ 1
- 0
frappe/config/setup.py Vedi File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
from frappe import _
from frappe.widgets.moduleview import add_setup_section



+ 1
- 0
frappe/config/website.py Vedi File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
from frappe import _

def get_data():


+ 2
- 4
frappe/core/doctype/communication/communication.py Vedi File

@@ -4,13 +4,12 @@
from __future__ import unicode_literals
import frappe
import json
import urllib
from email.utils import formataddr
from frappe.website.utils import is_signup_enabled
from frappe.utils import get_url, cstr
from frappe.utils.email_lib.email_body import get_email
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.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):
"""set portal link in footer"""

footer = ""

if is_signup_enabled():
is_valid_recipient = cstr(sent_via.get("email") or sent_via.get("email_id") or
sent_via.get("contact_email")) in comm.recipients
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 -->
<p><a href="%s" target="_blank">View this on our website</a></p>""" % url



+ 1
- 0
frappe/core/doctype/communication/test_communication.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals

import frappe
import unittest


+ 1
- 0
frappe/core/doctype/doctype/boilerplate/test_controller.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, {app_publisher} and Contributors
# See license.txt
from __future__ import unicode_literals

import frappe
import unittest


+ 1
- 0
frappe/core/doctype/email_alert/test_email_alert.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals

import frappe, frappe.utils, frappe.utils.scheduler
import unittest


+ 1
- 0
frappe/core/doctype/event/test_event.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

"""Use blog post test to test user permissions logic"""



+ 1
- 0
frappe/core/doctype/letter_head/test_letter_head.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

import frappe


+ 1
- 0
frappe/core/doctype/page/test_page.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals

import frappe
import unittest


+ 1
- 0
frappe/core/doctype/print_format/test_print_format.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals

import frappe
import unittest


+ 1
- 0
frappe/core/doctype/role/test_role.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

import frappe


+ 1
- 0
frappe/core/doctype/user/test_user.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

import frappe, unittest



+ 1
- 0
frappe/core/doctype/version/test_version.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals

import frappe
import unittest


+ 1
- 0
frappe/core/doctype/workflow_state/test_workflow_state.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

import frappe


+ 1
- 0
frappe/core/page/data_import_tool/test_exporter_fixtures.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

import frappe
import frappe.defaults


+ 1
- 0
frappe/hooks.py Vedi File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
app_name = "frappe"
app_title = "Frappe Framework"
app_publisher = "Web Notes Technologies Pvt. Ltd."


+ 1
- 1
frappe/model/db_schema.py Vedi File

@@ -24,7 +24,7 @@ type_map = {
,'Small Text': ('text', '')
,'Long Text': ('longtext', '')
,'Code': ('text', '')
,'Text Editor': ('text', '')
,'Text Editor': ('longtext', '')
,'Date': ('date', '')
,'Datetime': ('datetime', '6')
,'Time': ('time', '6')


+ 1
- 0
frappe/patches/v4_0/add_delete_permission.py Vedi File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
import frappe

def execute():


+ 1
- 0
frappe/patches/v4_0/remove_index_sitemap.py Vedi File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
import frappe

def execute():


+ 1
- 0
frappe/patches/v4_0/rename_profile_to_user.py Vedi File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
import frappe

from frappe.model import rename_field


+ 1
- 0
frappe/patches/v4_0/rename_sitemap_to_route.py Vedi File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
import frappe

from frappe.model import rename_field


+ 1
- 0
frappe/patches/v4_0/set_todo_checked_as_closed.py Vedi File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
import frappe

def execute():


+ 1
- 0
frappe/patches/v4_0/set_website_route_idx.py Vedi File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
import frappe

def execute():


+ 1
- 0
frappe/patches/v4_0/update_datetime.py Vedi File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
import frappe

def execute():


+ 1
- 0
frappe/patches/v4_0/webnotes_to_frappe.py Vedi File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
import frappe, json

def execute():


+ 1
- 0
frappe/patches/v4_2/refactor_website_routing.py Vedi File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
import frappe

def execute():


+ 1
- 0
frappe/patches/v4_2/set_assign_in_doc.py Vedi File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
import frappe

def execute():


+ 1
- 0
frappe/setup_logging.py Vedi File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
import frappe
import logging
import logging.config


+ 1
- 0
frappe/templates/includes/comments.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

import frappe
import frappe.utils, markdown2


+ 1
- 0
frappe/templates/pages/404.py Vedi File

@@ -1,4 +1,5 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

no_sitemap = 1

+ 1
- 0
frappe/templates/pages/update_password.py Vedi File

@@ -1,4 +1,5 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

no_sitemap = 1

+ 1
- 0
frappe/tests/test_assign.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2014, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

import frappe, unittest
import frappe.widgets.form.assign_to


+ 1
- 0
frappe/tests/test_client_login.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

import unittest, frappe
from frappe.utils import sel


+ 1
- 0
frappe/tests/test_data_import.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2014, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

import frappe, unittest
from frappe.core.page.data_import_tool import exporter


+ 1
- 0
frappe/tests/test_db_query.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

import frappe, unittest



+ 1
- 0
frappe/tests/test_defaults.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

import frappe, unittest



+ 1
- 0
frappe/tests/test_document.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

import frappe, unittest



+ 1
- 0
frappe/tests/test_filemanager.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

import frappe
import os


+ 1
- 0
frappe/tests/test_fmt_money.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

import frappe
from frappe import _


+ 1
- 0
frappe/tests/test_form_load.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

import frappe, unittest
from frappe.widgets.form.meta import get_meta


+ 1
- 0
frappe/tests/test_geo_ip.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

import frappe
import unittest


+ 1
- 0
frappe/tests/test_translation.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

import frappe, unittest, os
import frappe.translate


+ 1
- 0
frappe/utils/bench_helper.py Vedi File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
import click
import frappe
import importlib


+ 4
- 1
frappe/utils/data.py Vedi File

@@ -583,10 +583,13 @@ def 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_url(match):
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 re.sub('(href|src){1}([\s]*=[\s]*[\'"]?)((?:http)[^\'">]+)([\'"]?)',
_quote_url, html)


+ 1
- 0
frappe/utils/doctor.py Vedi File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
import json, base64, os
import frappe.cli
from frappe.celery_app import get_celery


+ 1
- 0
frappe/utils/email_lib/html2text.py Vedi File

@@ -1,5 +1,6 @@
#!/usr/bin/env python
"""html2text: Turn HTML into equivalent Markdown-structured text."""
from __future__ import unicode_literals
__version__ = "3.200.3"
__author__ = "Aaron Swartz (me@aaronsw.com)"
__copyright__ = "(C) 2004-2008 Aaron Swartz. GNU GPL 3."


+ 1
- 0
frappe/utils/minify.py Vedi File

@@ -27,6 +27,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# */
from __future__ import unicode_literals

from StringIO import StringIO



+ 1
- 0
frappe/utils/momentjs.py Vedi File

@@ -1,4 +1,5 @@
# get data for moment.js
from __future__ import unicode_literals
def update(tz, out):
ltz = data["links"].get(tz, tz)
zone = data["zones"].get(ltz)


+ 1
- 0
frappe/utils/pdf.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

import pdfkit, os, frappe
from frappe.utils import scrub_urls


+ 1
- 0
frappe/website/doctype/blog_category/test_blog_category.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

import frappe


+ 1
- 0
frappe/website/doctype/blog_post/test_blog_post.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals

"""Use blog post test to test user permissions logic"""



+ 1
- 0
frappe/website/doctype/blogger/test_blogger.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals


import frappe

+ 1
- 0
frappe/website/doctype/web_form/test_web_form.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals

import frappe
import unittest


+ 1
- 0
frappe/website/doctype/website_group/test_website_group.py Vedi File

@@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals

import frappe
import unittest


Caricamento…
Annulla
Salva