xrange to range (#3237)
* introduces build status for local fork * converts xrange to range using six.moves.range7 * converts xrange to range using six.moves.range7 * converts xrange to range using six.moves.range7 * converts xrange to range using six.moves.range * converts xrange to range using six.moves.range * converts xrange to range using six.moves.range7 * converts xrange to range using six.moves.range7 * converts xrange to range using six.moves.range7 * converts xrange to range using six.moves.range7 * converts xrange to range using six.moves.range7 * converts xrange to range using six.moves.range7 * converts xrange to range using six.moves.range7 * converts xrange to range using six.moves.range7 * Revert "introduces build status for local fork" This reverts commit 61f40983d0b3c6725369171ab850a18e5c029cc4.
This commit is contained in:
parent
6fbe20caaa
commit
6e29d9e925
13 changed files with 28 additions and 15 deletions
|
|
@ -2,6 +2,7 @@
|
|||
# MIT License. See license.txt
|
||||
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
from six.moves import range
|
||||
import frappe
|
||||
import json
|
||||
from email.utils import formataddr, parseaddr
|
||||
|
|
@ -417,7 +418,7 @@ def sendmail(communication_name, print_html=None, print_format=None, attachments
|
|||
frappe.local.session.update(session)
|
||||
|
||||
# upto 3 retries
|
||||
for i in xrange(3):
|
||||
for i in range(3):
|
||||
try:
|
||||
communication = frappe.get_doc("Communication", communication_name)
|
||||
communication._notify(print_html=print_html, print_format=print_format, attachments=attachments,
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
from __future__ import unicode_literals, print_function
|
||||
|
||||
from six.moves import range
|
||||
import requests
|
||||
import frappe, json
|
||||
import frappe.permissions
|
||||
|
|
@ -102,7 +103,7 @@ def upload(rows = None, submit_after_import=None, ignore_encoding_errors=False,
|
|||
def get_doc(start_idx):
|
||||
if doctypes:
|
||||
doc = {}
|
||||
for idx in xrange(start_idx, len(rows)):
|
||||
for idx in range(start_idx, len(rows)):
|
||||
if (not doc) or main_doc_empty(rows[idx]):
|
||||
for dt, parentfield in doctypes:
|
||||
d = {}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
# MIT License. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from six.moves import range
|
||||
import frappe
|
||||
import json
|
||||
|
||||
|
|
@ -147,7 +148,7 @@ def get_events(start, end, user=None, for_reminder=False, filters=None):
|
|||
date = date[0] + "-" + str(cint(date[1]) - 1) + "-" + date[2]
|
||||
|
||||
start_from = date
|
||||
for i in xrange(int(date_diff(end, start) / 30) + 3):
|
||||
for i in range(int(date_diff(end, start) / 30) + 3):
|
||||
if getdate(date) >= getdate(start) and getdate(date) <= getdate(end) \
|
||||
and getdate(date) <= getdate(repeat) and getdate(date) >= getdate(event_start):
|
||||
add_event(e, date)
|
||||
|
|
@ -163,7 +164,7 @@ def get_events(start, end, user=None, for_reminder=False, filters=None):
|
|||
# start from nearest weeday after last monday
|
||||
date = add_days(start, weekday - start_weekday)
|
||||
|
||||
for cnt in xrange(int(date_diff(end, start) / 7) + 3):
|
||||
for cnt in range(int(date_diff(end, start) / 7) + 3):
|
||||
if getdate(date) >= getdate(start) and getdate(date) <= getdate(end) \
|
||||
and getdate(date) <= getdate(repeat) and getdate(date) >= getdate(event_start):
|
||||
add_event(e, date)
|
||||
|
|
@ -173,7 +174,7 @@ def get_events(start, end, user=None, for_reminder=False, filters=None):
|
|||
remove_events.append(e)
|
||||
|
||||
if e.repeat_on=="Every Day":
|
||||
for cnt in xrange(date_diff(end, start) + 1):
|
||||
for cnt in range(date_diff(end, start) + 1):
|
||||
date = add_days(start, cnt)
|
||||
if getdate(date) >= getdate(event_start) and getdate(date) <= getdate(end) \
|
||||
and getdate(date) <= getdate(repeat) and e[weekdays[getdate(date).weekday()]]:
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
# MIT License. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from six.moves import range
|
||||
import frappe
|
||||
import json
|
||||
import copy
|
||||
|
|
@ -75,7 +76,7 @@ def get_data(doctypes, last_modified):
|
|||
link_map = {}
|
||||
doctype_data = out[link[0]]
|
||||
col_idx = doctype_data["columns"].index(link[1])
|
||||
for row_idx in xrange(len(doctype_data["data"])):
|
||||
for row_idx in range(len(doctype_data["data"])):
|
||||
row = doctype_data["data"][row_idx]
|
||||
link_map[row[col_idx]] = row_idx
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ from __future__ import unicode_literals
|
|||
"""build query for doclistview and return results"""
|
||||
|
||||
import frappe, json
|
||||
from six.moves import range
|
||||
import frappe.permissions
|
||||
import MySQLdb
|
||||
from frappe.model.db_query import DatabaseQuery
|
||||
|
|
@ -173,7 +174,7 @@ def append_totals_row(data):
|
|||
totals.extend([""]*len(data[0]))
|
||||
|
||||
for row in data:
|
||||
for i in xrange(len(row)):
|
||||
for i in range(len(row)):
|
||||
if isinstance(row[i], (float, int)):
|
||||
totals[i] = (totals[i] or 0) + row[i]
|
||||
data.append(totals)
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
# MIT License. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from six.moves import range
|
||||
import frappe
|
||||
import HTMLParser
|
||||
import smtplib, quopri
|
||||
|
|
@ -289,7 +290,7 @@ def flush(from_test=False):
|
|||
|
||||
make_cache_queue()
|
||||
|
||||
for i in xrange(cache.llen('cache_email_queue')):
|
||||
for i in range(cache.llen('cache_email_queue')):
|
||||
email = cache.lpop('cache_email_queue')
|
||||
|
||||
if cint(frappe.defaults.get_defaults().get("hold_queue"))==1:
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
# MIT License. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from six.moves import range
|
||||
import time, _socket, poplib, imaplib, email, email.utils, datetime, chardet, re, hashlib
|
||||
from email_reply_parser import EmailReplyParser
|
||||
from email.header import decode_header
|
||||
|
|
@ -140,7 +141,7 @@ class EmailServer:
|
|||
num = num_copy
|
||||
if not cint(self.settings.use_imap):
|
||||
if num > 100 and not self.errors:
|
||||
for m in xrange(101, num+1):
|
||||
for m in range(101, num+1):
|
||||
self.pop.dele(m)
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from six.moves import range
|
||||
import frappe
|
||||
|
||||
|
||||
|
|
@ -66,7 +67,7 @@ def get_party_addresses_and_contact(party_type, party):
|
|||
contacts = map(list, contacts)
|
||||
|
||||
max_length = max(len(addresses), len(contacts))
|
||||
for idx in xrange(0, max_length):
|
||||
for idx in range(0, max_length):
|
||||
result = list(party_detail)
|
||||
|
||||
address = addresses[idx] if idx < len(addresses) else [ "" for field in field_map.get("Address", []) ]
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ Example:
|
|||
'''
|
||||
|
||||
from __future__ import unicode_literals, print_function
|
||||
from six.moves import range
|
||||
import frappe, json, os
|
||||
from frappe.utils import cstr, cint
|
||||
from frappe.model import default_fields, no_value_fields, optional_fields
|
||||
|
|
@ -281,7 +282,7 @@ class Meta(Document):
|
|||
newlist += [df for df in self.get('fields') if not df.get('is_custom_field')]
|
||||
|
||||
newlist_fieldnames = [df.fieldname for df in newlist]
|
||||
for i in xrange(2):
|
||||
for i in range(2):
|
||||
for df in list(custom_fields):
|
||||
if df.insert_after in newlist_fieldnames:
|
||||
cf = custom_fields.pop(custom_fields.index(df))
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
# MIT License. See license.txt
|
||||
|
||||
from __future__ import unicode_literals, print_function
|
||||
from six.moves import range
|
||||
import frappe
|
||||
from frappe.utils import cstr
|
||||
from frappe.build import html_to_js_template
|
||||
|
|
@ -41,7 +42,7 @@ def render_include(content):
|
|||
content = cstr(content)
|
||||
|
||||
# try 5 levels of includes
|
||||
for i in xrange(5):
|
||||
for i in range(5):
|
||||
if "{% include" in content:
|
||||
paths = re.findall(r'''{% include\s['"](.*)['"]\s%}''', content)
|
||||
if not paths:
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
# MIT License. See license.txt
|
||||
|
||||
from __future__ import unicode_literals, print_function
|
||||
from six.moves import range
|
||||
import frappe, copy, json
|
||||
from frappe import _, msgprint
|
||||
from frappe.utils import cint
|
||||
|
|
@ -435,7 +436,7 @@ def get_user_permission_doctypes(user_permission_doctypes, user_permissions):
|
|||
# for example, [["Blogger", "Blog Category"], ["Blogger"]], should only search in [["Blogger"]] as the first and condition becomes redundant
|
||||
|
||||
common = user_permission_doctypes[0]
|
||||
for i in xrange(1, len(user_permission_doctypes), 1):
|
||||
for i in range(1, len(user_permission_doctypes), 1):
|
||||
common = list(set(common).intersection(set(user_permission_doctypes[i])))
|
||||
if not common:
|
||||
break
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
# MIT License. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from six.moves import range
|
||||
import json, subprocess, os
|
||||
from semantic_version import Version
|
||||
import frappe
|
||||
|
|
@ -53,7 +54,7 @@ def get_change_log_for_app(app, from_version, to_version):
|
|||
# remove pre-release part
|
||||
to_version.prerelease = None
|
||||
|
||||
major_version_folders = ["v{0}".format(i) for i in xrange(from_version.major, to_version.major + 1)]
|
||||
major_version_folders = ["v{0}".format(i) for i in range(from_version.major, to_version.major + 1)]
|
||||
app_change_log = []
|
||||
|
||||
for folder in os.listdir(change_log_folder):
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import frappe, random
|
||||
from six.moves import range
|
||||
|
||||
settings = frappe._dict(
|
||||
prob = {
|
||||
|
|
@ -11,7 +12,7 @@ def add_random_children(doc, fieldname, rows, randomize, unique=None):
|
|||
if rows > 1:
|
||||
nrows = random.randrange(1, rows)
|
||||
|
||||
for i in xrange(nrows):
|
||||
for i in range(nrows):
|
||||
d = {}
|
||||
for key, val in randomize.items():
|
||||
if isinstance(val[0], basestring):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue