本文整理汇总了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)