本文整理汇总了Python中MOSES.getCategoryTree方法的典型用法代码示例。如果您正苦于以下问题:Python MOSES.getCategoryTree方法的具体用法?Python MOSES.getCategoryTree怎么用?Python MOSES.getCategoryTree使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MOSES
的用法示例。
在下文中一共展示了MOSES.getCategoryTree方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import MOSES [as 别名]
# 或者: from MOSES import getCategoryTree [as 别名]
def __init__(self, user_id, password, start_date, end_date = None, query_dict = None, category_tree = None, parent = None):
super(PiggyBanker, self).__init__(parent)
self.mutex = QtCore.QMutex()
self.condition = QtCore.QWaitCondition()
self.user_id = user_id
self.password = password
self.sleeper = 10
self.start_date = start_date
if query_dict is None:
#get all data for a writer between dates if only dates are given.
self.query_dict = {"WriterID": self.user_id}
else:
#If some query dictionary is supplied, get all data corresponding to that.
self.query_dict = query_dict
if end_date is None:
self.end_date = self.start_date
else:
self.end_date = end_date
if category_tree is None:
self.category_tree = MOSES.getCategoryTree(self.user_id, self.password)
else:
self.category_tree = category_tree
if not self.isRunning():
self.start(QtCore.QThread.LowPriority)
示例2: __init__
# 需要导入模块: import MOSES [as 别名]
# 或者: from MOSES import getCategoryTree [as 别名]
def __init__(self, userID, password, category_tree=None, *args, **kwargs):
"""Efficiency Calculator Initializer function."""
super(QtGui.QDialog, self).__init__()
self.userID = userID
self.password = password
if category_tree is None:
self.category_tree = MOSES.getCategoryTree(self.userID, self.password)
else:
self.category_tree = category_tree
self.target_date = datetime.date.today()
self.retrieved_data = None
self.allow_paste = False
self.calcList = []
self.createWidgets()
self.createLayouts()
self.createEvents()
self.setVisuals()
示例3: __init__
# 需要导入模块: import MOSES [as 别名]
# 或者: from MOSES import getCategoryTree [as 别名]
def __init__(self, user_id, password, category_tree=None, brands=None):
super(PiggyBankWithFilter, self).__init__()
self.user_id, self.password = user_id, password
if category_tree is not None:
self.category_tree = category_tree
else:
self.category_tree = MOSES.getCategoryTree(self.user_id, self.password)
if brands is None:
print "Pulling Brand list in PiggyBankWithFilter"
self.brands = MOSES.getBrandValues(self.user_id, self.password)
else:
self.brands = brands
self.createUI()
self.piggybank_data = []
self.mapEvents()
self.changePage()
self.populateBrand()
self.populateWriters()
self.show()
示例4: __init__
# 需要导入模块: import MOSES [as 别名]
# 或者: from MOSES import getCategoryTree [as 别名]
def __init__(self, user_id, password, category_tree=None):
super(DailyPorker, self).__init__()
self.user_id, self.password = user_id, password
self.report_list = []
if category_tree is None:
self.category_tree = MOSES.getCategoryTree(self.user_id, self.password)
else:
self.category_tree = category_tree
#self.pork_kent = PorkKent(self.user_id, self.password)
style_string = """
.QTableWidget {
gridline-color: rgb(0, 0, 0);
}
"""
self.setStyleSheet(style_string)
self.clip = QtGui.QApplication.clipboard()
self.createUI()
self.mapEvents()
self.initiate()
self.show()
示例5: __init__
# 需要导入模块: import MOSES [as 别名]
# 或者: from MOSES import getCategoryTree [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)