removed unnecessary imports

This commit is contained in:
Anand Doshi 2012-11-30 16:38:02 +05:30
parent cb73a34508
commit 0f69dbbd54
20 changed files with 6 additions and 52 deletions

View file

@ -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:

View file

@ -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:

View file

@ -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):

View file

@ -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:

View file

@ -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:

View file

@ -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

View file

@ -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):

View file

@ -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

View file

@ -38,7 +38,6 @@ import webnotes
import webnotes.handler
import webnotes.auth
from webnotes.utils import cstr
def init():
webnotes.handler.get_cgi_fields()

View file

@ -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()

View file

@ -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

View file

@ -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):

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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', \

View file

@ -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')

View file

@ -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

View file

@ -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 = {}

View file

@ -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):