Browse Source

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 years ago
committed by Rushabh Mehta
parent
commit
bab692ff59
3 changed files with 5 additions and 5 deletions
  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 View File

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

if hook_key=="app_name" and hook_val.lower().replace(" ", "_") != hook_val:
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):
print("App Title should start with a letter and it can only consist of letters, numbers, spaces and underscores")
hook_val = ""


+ 3
- 3
frappe/utils/global_search.py View File

@@ -218,9 +218,9 @@ def update_global_search(doc):
# Get children
for child in doc.meta.get_table_fields():
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))

if content:


+ 1
- 1
frappe/utils/jinja.py View File

@@ -47,7 +47,7 @@ def validate_template(html):
try:
jenv.from_string(html)
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"))

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


Loading…
Cancel
Save