本文整理匯總了Python中datalogger.DataLogger.get_projects方法的典型用法代碼示例。如果您正苦於以下問題:Python DataLogger.get_projects方法的具體用法?Python DataLogger.get_projects怎麽用?Python DataLogger.get_projects使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類datalogger.DataLogger
的用法示例。
在下文中一共展示了DataLogger.get_projects方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_projects
# 需要導入模塊: from datalogger import DataLogger [as 別名]
# 或者: from datalogger.DataLogger import get_projects [as 別名]
def get_projects(args):
"""
get available projects for this Datalogger Server
ex: Datalogger/get_projects/...
there is no further argument needed
returns:
json(existing project names)
"""
return json.dumps(DataLogger.get_projects(basedir))
示例2: get_projects
# 需要導入模塊: from datalogger import DataLogger [as 別名]
# 或者: from datalogger.DataLogger import get_projects [as 別名]
def get_projects():
"""
get available projects for this Datalogger Server
ex: Datalogger/get_projects/...
there is no further argument needed
returns:
json(existing project names)
"""
ret_data = {
"projects" : DataLogger.get_projects(basedir),
"stat_func_names" : TimeseriesStats.stat_funcs.keys(),
"last_businessday_datestring" : DataLogger.get_last_business_day_datestring()
}
return json.dumps(ret_data)
示例3: main
# 需要導入模塊: from datalogger import DataLogger [as 別名]
# 或者: from datalogger.DataLogger import get_projects [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)
示例4: setUp
# 需要導入模塊: from datalogger import DataLogger [as 別名]
# 或者: from datalogger.DataLogger import get_projects [as 別名]
def setUp(self):
self.basedir = "/var/rrd"
self.datestring = "2015-11-30"
self.project = DataLogger.get_projects(self.basedir)[0]
self.tablename = DataLogger.get_tablenames(self.basedir, self.project)[0]
self.datalogger = DataLogger(self.basedir, self.project, self.tablename)