瀏覽代碼

Replaced mixed usage of tabs and spaces for indents with tabs only (#3813)

Python 3 (PEP 8) strictly disallows mixed use of tabs and spaces
for indentation
frappe innstalltion only throws error on frappe/utils/jinja.py as
of now but the rest are almost equally likely to fail, so changed
all of them in one commit
version-14
Aditya Hase 8 年之前
committed by Rushabh Mehta
父節點
當前提交
bab692ff59
共有 3 個檔案被更改,包括 5 行新增5 行删除
  1. +1
    -1
      frappe/utils/boilerplate.py
  2. +3
    -3
      frappe/utils/global_search.py
  3. +1
    -1
      frappe/utils/jinja.py

+ 1
- 1
frappe/utils/boilerplate.py 查看文件

@@ -39,7 +39,7 @@ def make_boilerplate(dest, app_name):


if hook_key=="app_name" and hook_val.lower().replace(" ", "_") != hook_val: if hook_key=="app_name" and hook_val.lower().replace(" ", "_") != hook_val:
print("App Name must be all lowercase and without spaces") print("App Name must be all lowercase and without spaces")
hook_val = ""
hook_val = ""
elif hook_key=="app_title" and not re.match("^(?![\W])[^\d_\s][\w -]+$", hook_val, re.UNICODE): elif hook_key=="app_title" and not re.match("^(?![\W])[^\d_\s][\w -]+$", hook_val, re.UNICODE):
print("App Title should start with a letter and it can only consist of letters, numbers, spaces and underscores") print("App Title should start with a letter and it can only consist of letters, numbers, spaces and underscores")
hook_val = "" hook_val = ""


+ 3
- 3
frappe/utils/global_search.py 查看文件

@@ -218,9 +218,9 @@ def update_global_search(doc):
# Get children # Get children
for child in doc.meta.get_table_fields(): for child in doc.meta.get_table_fields():
for d in doc.get(child.fieldname): for d in doc.get(child.fieldname):
if d.parent == doc.name:
for field in d.meta.get_global_search_fields():
if d.get(field.fieldname):
if d.parent == doc.name:
for field in d.meta.get_global_search_fields():
if d.get(field.fieldname):
content.append(get_formatted_value(d.get(field.fieldname), field)) content.append(get_formatted_value(d.get(field.fieldname), field))


if content: if content:


+ 1
- 1
frappe/utils/jinja.py 查看文件

@@ -47,7 +47,7 @@ def validate_template(html):
try: try:
jenv.from_string(html) jenv.from_string(html)
except TemplateSyntaxError as e: except TemplateSyntaxError as e:
frappe.msgprint('Line {}: {}'.format(e.lineno, e.message))
frappe.msgprint('Line {}: {}'.format(e.lineno, e.message))
frappe.throw(frappe._("Syntax error in template")) frappe.throw(frappe._("Syntax error in template"))


def render_template(template, context, is_path=None): def render_template(template, context, is_path=None):


Loading…
取消
儲存