當前位置: 首頁>>代碼示例>>Python>>正文


Python MOSES.getCategoryTree方法代碼示例

本文整理匯總了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)
開發者ID:vinay87,項目名稱:oink,代碼行數:28,代碼來源:PiggyBanker.py

示例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()
開發者ID:vinay87,項目名稱:oink,代碼行數:19,代碼來源:EfficiencyCalculator.py

示例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()
開發者ID:vinay87,項目名稱:oink,代碼行數:21,代碼來源:PiggyBankWithFilter.py

示例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()
開發者ID:vinay87,項目名稱:oink,代碼行數:22,代碼來源:DailyPorker.py

示例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)
開發者ID:vinay87,項目名稱:oink,代碼行數:38,代碼來源:Porker.py


注:本文中的MOSES.getCategoryTree方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。