From 97f6843b1ce9806244b2572594e68b57fdcdaf82 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 9 Apr 2013 17:43:36 +0530 Subject: [PATCH] removed print statements --- patches/december_2012/repost_ordered_qty.py | 4 +--- patches/february_2013/fix_outstanding.py | 6 +----- patches/january_2013/file_list_rename_returns.py | 3 --- patches/july_2012/repost_stock_due_to_wrong_packing_list.py | 3 --- patches/mar_2012/doctype_get_refactor.py | 2 -- patches/march_2013/p03_update_buying_amount.py | 3 --- patches/march_2013/p08_create_aii_accounts.py | 6 +++--- patches/may_2012/reload_sales_invoice_pf.py | 1 - patches/october_2012/fix_cancelled_gl_entries.py | 3 +-- 9 files changed, 6 insertions(+), 25 deletions(-) diff --git a/patches/december_2012/repost_ordered_qty.py b/patches/december_2012/repost_ordered_qty.py index c798b6cc7c..4b046f1838 100644 --- a/patches/december_2012/repost_ordered_qty.py +++ b/patches/december_2012/repost_ordered_qty.py @@ -10,8 +10,6 @@ def execute(): and po_item.item_code = %s and po_item.warehouse = %s """, (d[0], d[1])) - if flt(d[3]) != flt(ordered_qty[0][0]): - print d[3], ordered_qty[0][0] - + if flt(d[3]) != flt(ordered_qty[0][0]): webnotes.conn.sql("""update `tabBin` set ordered_qty = %s where name = %s""", (ordered_qty and ordered_qty[0][0] or 0, d[2])) \ No newline at end of file diff --git a/patches/february_2013/fix_outstanding.py b/patches/february_2013/fix_outstanding.py index 22a6ee1740..8afc63f511 100644 --- a/patches/february_2013/fix_outstanding.py +++ b/patches/february_2013/fix_outstanding.py @@ -17,8 +17,4 @@ def execute(): if ((r["against_voucher_type"]=='Sales Invoice' and flt(r["outstanding"]) >= 0) \ or (r["against_voucher_type"]=="Purchase Invoice" and flt(["outstanding"]) <= 0)): webnotes.conn.set_value(r["against_voucher_type"], r["against_voucher"], - "outstanding_amount", abs(flt(r["outstanding"]))) - else: - print r["against_voucher_type"], r["against_voucher"], \ - outstanding[0][1], abs(flt(r["outstanding"])) - \ No newline at end of file + "outstanding_amount", abs(flt(r["outstanding"]))) \ No newline at end of file diff --git a/patches/january_2013/file_list_rename_returns.py b/patches/january_2013/file_list_rename_returns.py index cca7a15725..f897d5c4ec 100644 --- a/patches/january_2013/file_list_rename_returns.py +++ b/patches/january_2013/file_list_rename_returns.py @@ -34,10 +34,8 @@ def execute(): except Exception, e: # if duplicate entry, then dont update if e[0]!=1062: - print webnotes.getTraceback() raise e - print change_map changed_keys = change_map.keys() @@ -61,6 +59,5 @@ def execute(): except Exception, e: if e[0]!=1146: - print webnotes.getTraceback() raise e \ No newline at end of file diff --git a/patches/july_2012/repost_stock_due_to_wrong_packing_list.py b/patches/july_2012/repost_stock_due_to_wrong_packing_list.py index 81c6415644..615d7ed610 100644 --- a/patches/july_2012/repost_stock_due_to_wrong_packing_list.py +++ b/patches/july_2012/repost_stock_due_to_wrong_packing_list.py @@ -23,7 +23,6 @@ def repost_reserved_qty(): i = 0 for d in bins: i += 1 - print i reserved_qty = webnotes.conn.sql(""" select sum((dnpi_qty / so_item_qty) * (so_item_qty - so_item_delivered_qty)) @@ -54,7 +53,6 @@ def repost_reserved_qty(): """, (d[0], d[1])) if flt(d[3]) != flt(reserved_qty[0][0]): - print d[3], reserved_qty[0][0] webnotes.conn.sql(""" update `tabBin` set reserved_qty = %s where name = %s """, (reserved_qty and reserved_qty[0][0] or 0, d[2])) @@ -77,7 +75,6 @@ def cleanup_wrong_sle(): ) """) if sle: - print sle for d in sle: webnotes.conn.sql("update `tabStock Ledger Entry` set is_cancelled = 'Yes' where name = %s", d[3]) create_comment(d[3]) diff --git a/patches/mar_2012/doctype_get_refactor.py b/patches/mar_2012/doctype_get_refactor.py index c6bfb3129c..26402292b4 100644 --- a/patches/mar_2012/doctype_get_refactor.py +++ b/patches/mar_2012/doctype_get_refactor.py @@ -24,7 +24,6 @@ def handle_custom_fields(): * Create property setter entry of previous field * Remove custom fields from tabDocField """ - print "in handle custom fields" cf = get_cf() assign_idx(cf) create_prev_field_prop_setter(cf) @@ -120,7 +119,6 @@ def create_file_list(): webnotes.clear_cache(doctype=obj.doc.name) def change_to_decimal(): - print "in change to decimal" webnotes.conn.commit() tables = webnotes.conn.sql("SHOW TABLES") alter_tables_list = [] diff --git a/patches/march_2013/p03_update_buying_amount.py b/patches/march_2013/p03_update_buying_amount.py index 0d96feba4a..92b171f3e1 100644 --- a/patches/march_2013/p03_update_buying_amount.py +++ b/patches/march_2013/p03_update_buying_amount.py @@ -7,7 +7,6 @@ def execute(): webnotes.conn.auto_commit_on_many_writes = True for company in webnotes.conn.sql("select name from `tabCompany`"): - print company[0] stock_ledger_entries = webnotes.conn.sql("""select item_code, voucher_type, voucher_no, voucher_detail_no, posting_date, posting_time, stock_value, warehouse, actual_qty as qty from `tabStock Ledger Entry` @@ -17,7 +16,6 @@ def execute(): dn_list = webnotes.conn.sql("""select name from `tabDelivery Note` where docstatus < 2 and company = %s""", company[0]) - print "Total Delivery Note: ", len(dn_list) for dn in dn_list: dn = webnotes.get_obj("Delivery Note", dn[0], with_children = 1) @@ -25,7 +23,6 @@ def execute(): si_list = webnotes.conn.sql("""select name from `tabSales Invoice` where docstatus < 2 and company = %s""", company[0]) - print "Total Sales Invoice: ", len(si_list) for si in si_list: si = webnotes.get_obj("Sales Invoice", si[0], with_children = 1) si.set_buying_amount(stock_ledger_entries) diff --git a/patches/march_2013/p08_create_aii_accounts.py b/patches/march_2013/p08_create_aii_accounts.py index 30bfe9ef01..ac563b52fa 100644 --- a/patches/march_2013/p08_create_aii_accounts.py +++ b/patches/march_2013/p08_create_aii_accounts.py @@ -56,8 +56,8 @@ def add_accounts(accounts_to_add, check_fn=None): where company=%s and ifnull(parent_account, '')=''""", company)[0][0] if count > 4: - print "Company", company, \ - "has more than 4 root accounts. cannot apply patch to this company." + webnotes.errprint("Company" + company + + "has more than 4 root accounts. cannot apply patch to this company.") continue for account_name, parent_account_name, group_or_ledger, account_type in accounts_to_add: @@ -82,7 +82,7 @@ def add_aii_cost_center(): {"parent_cost_center['']": '', "company_name": company}) if not parent_cost_center: - print "Company", company, "does not have a root cost center" + webnotes.errprint("Company " + company + "does not have a root cost center") continue cc = webnotes.bean({ diff --git a/patches/may_2012/reload_sales_invoice_pf.py b/patches/may_2012/reload_sales_invoice_pf.py index b784469d00..ea4f5dfde5 100644 --- a/patches/may_2012/reload_sales_invoice_pf.py +++ b/patches/may_2012/reload_sales_invoice_pf.py @@ -12,6 +12,5 @@ def execute(): 'Sales Invoice Spartan', 'Sales Invoice Modern' ]: - print r.get('name') webnotes.modules.reload_doc(r.get('module'), 'Print Format', r.get('name')) \ No newline at end of file diff --git a/patches/october_2012/fix_cancelled_gl_entries.py b/patches/october_2012/fix_cancelled_gl_entries.py index 9d23619d93..5c23ce8835 100644 --- a/patches/october_2012/fix_cancelled_gl_entries.py +++ b/patches/october_2012/fix_cancelled_gl_entries.py @@ -12,5 +12,4 @@ def execute(): where voucher_type = %s and voucher_no = %s""", (entry['voucher_type'], entry['voucher_no'])) except Exception, e: - print entry - print e + pass \ No newline at end of file