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


Python DataLogger.get_ts_for_datestring方法代碼示例

本文整理匯總了Python中datalogger.DataLogger.get_ts_for_datestring方法的典型用法代碼示例。如果您正苦於以下問題:Python DataLogger.get_ts_for_datestring方法的具體用法?Python DataLogger.get_ts_for_datestring怎麽用?Python DataLogger.get_ts_for_datestring使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在datalogger.DataLogger的用法示例。


在下文中一共展示了DataLogger.get_ts_for_datestring方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_statics

# 需要導入模塊: from datalogger import DataLogger [as 別名]
# 或者: from datalogger.DataLogger import get_ts_for_datestring [as 別名]
 def test_statics(self):
     self.assertTrue(isinstance(DataLogger.get_user(self.basedir), basestring))
     self.assertTrue(isinstance(DataLogger.get_group(self.basedir), basestring))
     self.assertTrue(isinstance(DataLogger.get_yesterday_datestring(), basestring))
     lbd = DataLogger.get_last_business_day_datestring()
     self.assertTrue(isinstance(DataLogger.get_last_business_day_datestring(), basestring))
     self.assertTrue(isinstance(DataLogger.datestring_to_date(lbd), datetime.date))
     for datestring in DataLogger.datewalker("2016-01-01", "2016-02-29"):
         self.assertTrue(isinstance(datestring, basestring))
     for datestring in DataLogger.monthwalker("2016-02"):
         self.assertTrue(isinstance(datestring, basestring))
     self.assertEqual(list(DataLogger.monthwalker("2016-02"))[-1], "2016-02-29")
     self.assertTrue(isinstance(DataLogger.get_ts_for_datestring("2016-01-01"), tuple))
     self.assertTrue(isinstance(DataLogger.get_ts_for_datestring("2016-01-01")[0], float))
     self.assertTrue(isinstance(DataLogger.get_ts_for_datestring("2016-01-01")[1], float))
開發者ID:gunny26,項目名稱:datalogger,代碼行數:17,代碼來源:test_DataLogger.py

示例2: main

# 需要導入模塊: from datalogger import DataLogger [as 別名]
# 或者: from datalogger.DataLogger import get_ts_for_datestring [as 別名]
def main():
    for datestring in tuple(DataLogger.datewalker(startdate, args.enddate)):
        start_ts, stop_ts = DataLogger.get_ts_for_datestring(datestring)
        logging.debug("working on datestring %s (from %s to %s)", datestring, start_ts, stop_ts)
        for project in DataLogger.get_projects(args.basedir):
            if args.project is not None:
                if project != args.project:
                    logging.debug("skipping project %s", project)
                    continue
            logging.debug("working on project %s", project)
            for tablename in DataLogger.get_tablenames(args.basedir, project):
                if args.tablename is not None:
                    if tablename != args.tablename:
                        logging.debug("skipping tablename %s", tablename)
                        continue
                    logging.debug("working on tablename %s", tablename)
                archive(project, tablename, datestring)
開發者ID:gunny26,項目名稱:datalogger,代碼行數:19,代碼來源:archiver.py


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