@@ -90,9 +90,7 @@ class DocType: | |||||
self.change_modified_of_parent() | self.change_modified_of_parent() | ||||
import conf | import conf | ||||
from webnotes.modules.import_file import in_import | |||||
if (not in_import) and getattr(conf,'developer_mode', 0): | |||||
if (not webnotes.in_import) and getattr(conf, 'developer_mode', 0): | |||||
self.export_doc() | self.export_doc() | ||||
self.make_controller_template() | self.make_controller_template() | ||||
@@ -53,8 +53,7 @@ class DocType: | |||||
it will write out a .html file | it will write out a .html file | ||||
""" | """ | ||||
import conf | import conf | ||||
from webnotes.modules.import_file import in_import | |||||
if not in_import and getattr(conf,'developer_mode', 0) and self.doc.standard=='Yes': | |||||
if not webnotes.in_import and getattr(conf,'developer_mode', 0) and self.doc.standard=='Yes': | |||||
from webnotes.modules.export_file import export_to_files | from webnotes.modules.export_file import export_to_files | ||||
from webnotes.modules import get_module_path, scrub | from webnotes.modules import get_module_path, scrub | ||||
import os | import os | ||||
@@ -76,6 +76,7 @@ request_method = None | |||||
print_messages = False | print_messages = False | ||||
user_lang = False | user_lang = False | ||||
lang = 'en' | lang = 'en' | ||||
in_import = False | |||||
# memcache | # memcache | ||||
@@ -34,8 +34,7 @@ def export_to_files(record_list=[], record_module=None, verbose=0): | |||||
""" | """ | ||||
Export record_list to files. record_list is a list of lists ([doctype],[docname] ) , | Export record_list to files. record_list is a list of lists ([doctype],[docname] ) , | ||||
""" | """ | ||||
from webnotes.modules.import_file import in_import | |||||
if in_import: | |||||
if webnotes.in_import: | |||||
return | return | ||||
module_doclist =[] | module_doclist =[] | ||||
@@ -25,8 +25,6 @@ from __future__ import unicode_literals | |||||
import webnotes, os | import webnotes, os | ||||
from webnotes.modules import scrub, get_module_path, scrub_dt_dn | from webnotes.modules import scrub, get_module_path, scrub_dt_dn | ||||
in_import = False | |||||
def import_files(module, dt=None, dn=None, force=False): | def import_files(module, dt=None, dn=None, force=False): | ||||
if type(module) is list: | if type(module) is list: | ||||
for m in module: | for m in module: | ||||
@@ -36,14 +34,13 @@ def import_files(module, dt=None, dn=None, force=False): | |||||
def import_file(module, dt, dn, force=False): | def import_file(module, dt, dn, force=False): | ||||
"""Sync a file from txt if modifed, return false if not updated""" | """Sync a file from txt if modifed, return false if not updated""" | ||||
global in_import | |||||
in_import = True | |||||
webnotes.in_import = True | |||||
dt, dn = scrub_dt_dn(dt, dn) | dt, dn = scrub_dt_dn(dt, dn) | ||||
path = os.path.join(get_module_path(module), | path = os.path.join(get_module_path(module), | ||||
os.path.join(dt, dn, dn + '.txt')) | os.path.join(dt, dn, dn + '.txt')) | ||||
ret = import_file_by_path(path, force) | ret = import_file_by_path(path, force) | ||||
in_import = False | |||||
webnotes.in_import = False | |||||
return ret | return ret | ||||
def import_file_by_path(path, force=False): | def import_file_by_path(path, force=False): | ||||
@@ -192,11 +192,11 @@ def build_filter_conditions(filters, conditions): | |||||
def build_match_conditions(doctype, fields=None): | def build_match_conditions(doctype, fields=None): | ||||
"""add match conditions if applicable""" | """add match conditions if applicable""" | ||||
global tables | |||||
match_conditions = [] | match_conditions = [] | ||||
match = True | match = True | ||||
if not tables or not doctypes: | if not tables or not doctypes: | ||||
global tables | |||||
tables = get_tables(doctype, fields) | tables = get_tables(doctype, fields) | ||||
load_doctypes() | load_doctypes() | ||||