diff --git a/core/doctype/communication/communication.py b/core/doctype/communication/communication.py index cc4aca3a57..3efde4ecad 100644 --- a/core/doctype/communication/communication.py +++ b/core/doctype/communication/communication.py @@ -16,7 +16,6 @@ from __future__ import unicode_literals import webnotes -from webnotes.model.doc import make_autoname @webnotes.whitelist() def get_customer_supplier(args=None): @@ -65,7 +64,6 @@ def make(doctype=None, name=None, content=None, subject=None, d.save(1, ignore_fields=True) def send_comm_email(d, name, sent_via=None, print_html=None, attachments='[]', send_me_a_copy=False): - from webnotes.utils.email_lib import sendmail from json import loads if sent_via: diff --git a/core/doctype/control_panel/control_panel.py b/core/doctype/control_panel/control_panel.py index 6cc5fe6c42..cad9748815 100644 --- a/core/doctype/control_panel/control_panel.py +++ b/core/doctype/control_panel/control_panel.py @@ -20,18 +20,12 @@ # OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -# Please edit this list and import only required elements from __future__ import unicode_literals import webnotes -from webnotes.utils import cint, flt -from webnotes.model.doc import Document -from webnotes.model.code import get_obj -from webnotes import session, form, msgprint, errprint +from webnotes import form, msgprint -get_value = webnotes.conn.get_value -# ----------------------------------------------------------------------------------------- class DocType: diff --git a/core/doctype/custom_field/custom_field.py b/core/doctype/custom_field/custom_field.py index c0d35e9765..ee9f1e6f49 100644 --- a/core/doctype/custom_field/custom_field.py +++ b/core/doctype/custom_field/custom_field.py @@ -20,13 +20,10 @@ # OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -# Please edit this list and import only required elements from __future__ import unicode_literals import webnotes from webnotes.utils import cint, cstr -from webnotes.model.doc import Document -from webnotes import msgprint class DocType: def __init__(self, d, dl): diff --git a/core/doctype/doctype/doctype.py b/core/doctype/doctype/doctype.py index b01749c789..fce3f1124b 100644 --- a/core/doctype/doctype/doctype.py +++ b/core/doctype/doctype/doctype.py @@ -20,7 +20,6 @@ # OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -# Please edit this list and import only required elements from __future__ import unicode_literals import webnotes @@ -28,7 +27,6 @@ from webnotes.utils import now, cint msgprint = webnotes.msgprint -# ----------------------------------------------------------------------------------------- class DocType: diff --git a/core/doctype/doctype_mapper/doctype_mapper.py b/core/doctype/doctype_mapper/doctype_mapper.py index e39c6d70ed..8d8a6182ae 100644 --- a/core/doctype/doctype_mapper/doctype_mapper.py +++ b/core/doctype/doctype_mapper/doctype_mapper.py @@ -20,25 +20,18 @@ # OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -# Please edit this list and import only required elements from __future__ import unicode_literals import webnotes -from webnotes.utils import cint, cstr, default_fields, flt, formatdate, get_defaults, getdate, now, nowdate, replace_newlines, set_default +from webnotes.utils import cint, cstr, default_fields, flt from webnotes.model import db_exists, default_fields -from webnotes.model.doc import Document, addchild, getchildren, make_autoname +from webnotes.model.doc import Document, addchild, make_autoname from webnotes.model.wrapper import getlist -from webnotes.model.code import get_obj -from webnotes import session, form, msgprint, errprint +from webnotes import msgprint from webnotes.model.doctype import get -set = webnotes.conn.set sql = webnotes.conn.sql -get_value = webnotes.conn.get_value -in_transaction = webnotes.conn.in_transaction -convert_to_lists = webnotes.conn.convert_to_lists -# ----------------------------------------------------------------------------------------- class DocType: diff --git a/core/doctype/letter_head/letter_head.py b/core/doctype/letter_head/letter_head.py index 861380a0d5..d0d0471f27 100755 --- a/core/doctype/letter_head/letter_head.py +++ b/core/doctype/letter_head/letter_head.py @@ -20,10 +20,8 @@ # OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -# Please edit this list and import only required elements from __future__ import unicode_literals import webnotes -from webnotes import msgprint sql = webnotes.conn.sql diff --git a/core/doctype/search_criteria/search_criteria.py b/core/doctype/search_criteria/search_criteria.py index dc71c42242..2039e7c034 100644 --- a/core/doctype/search_criteria/search_criteria.py +++ b/core/doctype/search_criteria/search_criteria.py @@ -20,13 +20,11 @@ # OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -# Please edit this list and import only required elements from __future__ import unicode_literals import webnotes from webnotes.utils import cint -# ----------------------------------------------------------------------------------------- class DocType: def __init__(self,d,dl): diff --git a/core/doctype/system_console/system_console.py b/core/doctype/system_console/system_console.py index c1c80c6831..77ada5bc67 100644 --- a/core/doctype/system_console/system_console.py +++ b/core/doctype/system_console/system_console.py @@ -23,10 +23,6 @@ from __future__ import unicode_literals import webnotes -from webnotes.utils import cint, flt -from webnotes.model.doc import Document -from webnotes.model.code import get_obj -from webnotes import session, msgprint, errprint sql = webnotes.conn.sql diff --git a/public/html/server.py b/public/html/server.py index 06e04c8183..0a6b7399ae 100755 --- a/public/html/server.py +++ b/public/html/server.py @@ -38,7 +38,6 @@ import webnotes import webnotes.handler import webnotes.auth -from webnotes.utils import cstr def init(): webnotes.handler.get_cgi_fields() diff --git a/webnotes/boot.py b/webnotes/boot.py index 9859a05f22..78f4920228 100644 --- a/webnotes/boot.py +++ b/webnotes/boot.py @@ -42,7 +42,6 @@ def get_bootinfo(): # control panel cp = webnotes.model.doc.getsingle('Control Panel') - from webnotes.utils import cint # system info bootinfo['control_panel'] = cp.copy() diff --git a/webnotes/memc.py b/webnotes/memc.py index 3c4857673d..6cf8cdfe31 100644 --- a/webnotes/memc.py +++ b/webnotes/memc.py @@ -22,7 +22,6 @@ from __future__ import unicode_literals import memcache, conf -from webnotes.utils import cstr class MClient(memcache.Client): """memcache client that will automatically prefix conf.db_name diff --git a/webnotes/model/code.py b/webnotes/model/code.py index e73015da8e..07ddbdbb6a 100644 --- a/webnotes/model/code.py +++ b/webnotes/model/code.py @@ -35,23 +35,17 @@ methods in following modules are imported for backward compatibility * webnotes.model.wrapper.* """ custom_class = ''' -# Please edit this list and import only required elements import webnotes from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add from webnotes.model import db_exists -from webnotes.model.doc import Document, addchild, getchildren, make_autoname +from webnotes.model.doc import Document, addchild, getchildren from webnotes.model.utils import getlist from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax from webnotes import session, form, msgprint, errprint -set = webnotes.conn.set sql = webnotes.conn.sql -get_value = webnotes.conn.get_value -in_transaction = webnotes.conn.in_transaction -convert_to_lists = webnotes.conn.convert_to_lists -# ----------------------------------------------------------------------------------------- class CustomDocType(DocType): def __init__(self, doc, doclist): diff --git a/webnotes/model/db_schema.py b/webnotes/model/db_schema.py index 92d380f354..b3a4fa6cff 100644 --- a/webnotes/model/db_schema.py +++ b/webnotes/model/db_schema.py @@ -56,7 +56,6 @@ default_columns = ['name', 'creation', 'modified', 'modified_by', 'owner', 'docs default_shortcuts = ['_Login', '__user', '_Full Name', 'Today', '__today'] -from webnotes.utils import cint import _mysql_exceptions diff --git a/webnotes/model/sync.py b/webnotes/model/sync.py index a997844e83..7c2f125c36 100644 --- a/webnotes/model/sync.py +++ b/webnotes/model/sync.py @@ -107,7 +107,6 @@ def delete_doctype_docfields(doclist): def save_doctype_docfields(doclist): from webnotes.model.doc import Document - from webnotes.model.code import get_obj parent_doc = Document(fielddata=doclist[0]) parent_doc.save(1, check_links=0, ignore_fields=1) diff --git a/webnotes/profile.py b/webnotes/profile.py index b328aa8649..70d3b4958e 100644 --- a/webnotes/profile.py +++ b/webnotes/profile.py @@ -166,7 +166,6 @@ class Profile: Update the user's `Recent` list with the given `dt` and `dn` """ conn = webnotes.conn - from webnotes.utils import cstr import json diff --git a/webnotes/widgets/form/comments.py b/webnotes/widgets/form/comments.py index 14154a6c75..8787274112 100644 --- a/webnotes/widgets/form/comments.py +++ b/webnotes/widgets/form/comments.py @@ -50,7 +50,6 @@ def add_comment(args=None): if args.get('comment'): from webnotes.model.doc import Document - from webnotes.utils import nowdate cmt = Document('Comment') for arg in ['comment', 'comment_by', 'comment_by_fullname', 'comment_doctype', \ diff --git a/webnotes/widgets/form/load.py b/webnotes/widgets/form/load.py index 90f1fb52c7..686c3d078c 100644 --- a/webnotes/widgets/form/load.py +++ b/webnotes/widgets/form/load.py @@ -33,7 +33,6 @@ def getdoc(): """ import webnotes - from webnotes.utils import cint form = webnotes.form_dict doctype, docname = form.get('doctype'), form.get('name') diff --git a/webnotes/widgets/query_builder.py b/webnotes/widgets/query_builder.py index 87e0fef648..f3d955bf95 100644 --- a/webnotes/widgets/query_builder.py +++ b/webnotes/widgets/query_builder.py @@ -131,9 +131,6 @@ def exec_report(code, res, colnames=[], colwidths=[], coltypes=[], coloptions=[] from webnotes import * from webnotes.utils import * from webnotes.model.doc import * - from webnotes.model.wrapper import getlist - from webnotes.model.db_schema import updatedb - from webnotes.model.code import get_obj set = webnotes.conn.set sql = webnotes.conn.sql diff --git a/webnotes/widgets/report_dump.py b/webnotes/widgets/report_dump.py index 1e447e7937..00b06bc52a 100644 --- a/webnotes/widgets/report_dump.py +++ b/webnotes/widgets/report_dump.py @@ -27,7 +27,6 @@ import json @webnotes.whitelist() def get_data(): from startup.report_data_map import data_map - from webnotes.utils import cstr import datetime doctypes = json.loads(webnotes.form_dict.get("doctypes")) out = {} diff --git a/webnotes/widgets/tags.py b/webnotes/widgets/tags.py index d58daaab92..4196e84ca1 100644 --- a/webnotes/widgets/tags.py +++ b/webnotes/widgets/tags.py @@ -44,7 +44,7 @@ Design: """ import webnotes -from webnotes.utils import cint, cstr, load_json +from webnotes.utils import load_json def check_user_tags(dt):