本文整理汇总了Python中DataStore.params方法的典型用法代码示例。如果您正苦于以下问题:Python DataStore.params方法的具体用法?Python DataStore.params怎么用?Python DataStore.params使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataStore
的用法示例。
在下文中一共展示了DataStore.params方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: in
# 需要导入模块: import DataStore [as 别名]
# 或者: from DataStore import params [as 别名]
print >>sys.stderr, 'Error: %s\n' % msg
print >>sys.stderr, __usage__.strip()
return 1
# process options
clear = False
sync = None
verbose = 0
for o, a in opts:
if o in ('-h', '--help'):
print __usage__.strip()
return 0
elif o in ('-c', '--clear'):
clear = True
elif o in ('-s', '--sync'):
sync = int(a)
elif o in ('-v', '--verbose'):
verbose += 1
# check arguments
if len(args) != 1:
print >>sys.stderr, 'Error: 1 argument required\n'
print >>sys.stderr, __usage__.strip()
return 2
logger = ApplicationLogger(verbose)
root_dir = args[0]
return LogData(
DataStore.params(root_dir), DataStore.data_store(root_dir),
sync=sync, clear=clear)
if __name__ == "__main__":
sys.exit(main())
示例2: in
# 需要导入模块: import DataStore [as 别名]
# 或者: from DataStore import params [as 别名]
except getopt.error, msg:
print >>sys.stderr, 'Error: %s\n' % msg
print >>sys.stderr, __doc__.strip()
return 1
# process options
for o, a in opts:
if o in ('-h', '--help'):
print __doc__.strip()
return 0
# check arguments
if len(args) != 1:
print >>sys.stderr, "Error: 1 argument required"
print >>sys.stderr, __doc__.strip()
return 2
data_dir = args[0]
params = DataStore.params(data_dir)
Localisation.SetApplicationLanguage(params)
hourly_data = DataStore.hourly_store(data_dir)
idx = hourly_data.before(datetime.max)
print 'Zambretti (current):', Zambretti(params, hourly_data[idx])
idx = idx.replace(tzinfo=utc).astimezone(Local)
if idx.hour < 9:
idx -= timedelta(hours=24)
idx = idx.replace(hour=9, minute=0, second=0)
idx = hourly_data.nearest(idx.astimezone(utc).replace(tzinfo=None))
print 'Zambretti (at 9am):', Zambretti(params, hourly_data[idx])
return 0
if __name__ == "__main__":
sys.exit(main())
示例3: len
# 需要导入模块: import DataStore [as 别名]
# 或者: from DataStore import params [as 别名]
opts, args = getopt.getopt(
argv[1:], "hcv", ['help', 'catchup', 'verbose'])
except getopt.error, msg:
print >>sys.stderr, 'Error: %s\n' % msg
print >>sys.stderr, __usage__.strip()
return 1
# process options
catchup = False
verbose = 0
for o, a in opts:
if o == '-h' or o == '--help':
print __usage__.strip()
return 0
elif o == '-c' or o == '--catchup':
catchup = True
elif o == '-v' or o == '--verbose':
verbose += 1
# check arguments
if len(args) != 2:
print >>sys.stderr, "Error: 2 arguments required"
print >>sys.stderr, __usage__.strip()
return 2
logger = ApplicationLogger(verbose)
return ToService(
DataStore.params(args[0]), DataStore.calib_store(args[0]),
service_name=args[1]
).Upload(catchup)
if __name__ == "__main__":
sys.exit(main())
示例4: main
# 需要导入模块: import DataStore [as 别名]
# 或者: from DataStore import params [as 别名]
return self.Upload(tweet)
def main(argv=None):
if argv is None:
argv = sys.argv
try:
opts, args = getopt.getopt(argv[1:], "h", ['help'])
except getopt.error, msg:
print >>sys.stderr, 'Error: %s\n' % msg
print >>sys.stderr, __usage__.strip()
return 1
# process options
for o, a in opts:
if o in ('-h', '--help'):
print __usage__.strip()
return 0
# check arguments
if len(args) != 2:
print >>sys.stderr, "Error: 2 arguments required"
print >>sys.stderr, __usage__.strip()
return 2
logger = ApplicationLogger(1)
params = DataStore.params(args[0])
Localisation.SetApplicationLanguage(params)
if ToTwitter(params).UploadFile(args[1]):
return 0
return 3
if __name__ == "__main__":
sys.exit(main())
示例5: main
# 需要导入模块: import DataStore [as 别名]
# 或者: from DataStore import params [as 别名]
def main(argv=None):
if argv is None:
argv = sys.argv
try:
opts, args = getopt.getopt(argv[1:], "h", ['help'])
except getopt.error, msg:
print >>sys.stderr, 'Error: %s\n' % msg
print >>sys.stderr, __usage__.strip()
return 1
# process options
for o, a in opts:
if o in ('-h', '--help'):
print __usage__.strip()
return 0
# check arguments
if len(args) != 1:
print >>sys.stderr, 'Error: 1 argument required\n'
print >>sys.stderr, __usage__.strip()
return 2
logger = ApplicationLogger(1)
data_dir = args[0]
return Process(DataStore.params(data_dir),
DataStore.data_store(data_dir),
DataStore.calib_store(data_dir),
DataStore.hourly_store(data_dir),
DataStore.daily_store(data_dir),
DataStore.monthly_store(data_dir))
if __name__ == "__main__":
sys.exit(main())
示例6: main
# 需要导入模块: import DataStore [as 别名]
# 或者: from DataStore import params [as 别名]
auth.get_access_token(pin)
except tweepy.TweepError:
print 'Failed to get access token.'
return 1
params.set('twitter', 'key', auth.access_token.key)
params.set('twitter', 'secret', auth.access_token.secret)
print 'Success! Authorisation data has been stored in %s' % params._path
return 0
def main(argv=None):
if argv is None:
argv = sys.argv
try:
opts, args = getopt.getopt(argv[1:], "h", ['help'])
except getopt.error, msg:
print >>sys.stderr, 'Error: %s\n' % msg
print >>sys.stderr, __usage__.strip()
return 1
# process options
for o, a in opts:
if o in ('-h', '--help'):
print __usage__.strip()
return 0
# check arguments
if len(args) != 1:
print >>sys.stderr, "Error: 1 argument required"
print >>sys.stderr, __usage__.strip()
return 2
return TwitterAuth(DataStore.params(args[0]))
if __name__ == "__main__":
sys.exit(main())
示例7: main
# 需要导入模块: import DataStore [as 别名]
# 或者: from DataStore import params [as 别名]
OK = False
ftp.close()
if secure:
transport.close()
return OK
def main(argv=None):
if argv is None:
argv = sys.argv
try:
opts, args = getopt.getopt(argv[1:], "h", ['help'])
except getopt.error, msg:
print >>sys.stderr, 'Error: %s\n' % msg
print >>sys.stderr, __doc__.strip()
return 1
# process options
for o, a in opts:
if o in ('-h', '--help'):
print __doc__.strip()
return 0
# check arguments
if len(args) < 2:
print >>sys.stderr, "Error: at least 2 arguments required"
print >>sys.stderr, __doc__.strip()
return 2
logger = ApplicationLogger(1)
if Upload(DataStore.params(args[0]), args[1:]):
return 0
return 3
if __name__ == "__main__":
sys.exit(main())