本文整理匯總了Python中MOSES.getDOJ方法的典型用法代碼示例。如果您正苦於以下問題:Python MOSES.getDOJ方法的具體用法?Python MOSES.getDOJ怎麽用?Python MOSES.getDOJ使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MOSES
的用法示例。
在下文中一共展示了MOSES.getDOJ方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: import MOSES [as 別名]
# 或者: from MOSES import getDOJ [as 別名]
def __init__(self, user_id, password, start_date, end_date=None, category_tree=None, *args, **kwargs):
"""New version.
"""
super(Porker, self).__init__(*args, **kwargs)
self.mutex = QtCore.QMutex()
self.condition = QtCore.QWaitCondition()
self.user_id, self.password = user_id, password
self.start_date = start_date
self.stats_date = start_date
self.stats_data = {}
#Prepare a list of dates to process.
r_span = 15
doj = MOSES.getDOJ(self.user_id, self.password)
db_origin = datetime.date(2015,1,1)
if db_origin>= doj:
db_origin_date = db_origin
else:
db_origin_date = doj
self.process_dates = list(reversed(OINKM.getDatesBetween(db_origin_date, start_date))) + OINKM.getDatesBetween((start_date+datetime.timedelta(days=1)), (start_date+datetime.timedelta(days=r_span)))
self.queue = []
self.force_update_dates = []
#Preload the category_tree.
self.result_dictionary = {}
if category_tree is not None:
self.category_tree = category_tree
else:
self.category_tree = MOSES.getCategoryTree(self.user_id, self.password)
if not self.isRunning():
self.start(QtCore.QThread.LowPriority)