当前位置: 首页>>代码示例>>Python>>正文


Python Time.timetostring方法代码示例

本文整理汇总了Python中Time.timetostring方法的典型用法代码示例。如果您正苦于以下问题:Python Time.timetostring方法的具体用法?Python Time.timetostring怎么用?Python Time.timetostring使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Time的用法示例。


在下文中一共展示了Time.timetostring方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _writer_helper

# 需要导入模块: import Time [as 别名]
# 或者: from Time import timetostring [as 别名]
	def _writer_helper(self, prefix, flatfileclass, typestr, time):
		"""Used in the get_xx_writer functions, returns a writer class"""
		if time is None: timestr = Time.curtimestr
		else: timestr = Time.timetostring(time)		
		filename = '%s.%s.%s' % (prefix, timestr, typestr)
		rp = Globals.rbdir.append(filename)
		assert not rp.lstat(), "File %s already exists!" % (rp.path,)
		assert rp.isincfile()
		return flatfileclass(rp, 'w', callback = self.add_incrp)
开发者ID:Christoph-D,项目名称:rdiff-backup,代码行数:11,代码来源:metadata.py

示例2: get_inc

# 需要导入模块: import Time [as 别名]
# 或者: from Time import timetostring [as 别名]
def get_inc(rp, typestr, time = None):
	"""Return increment like rp but with time and typestr suffixes

	To avoid any quoting, the returned rpath has empty index, and the
	whole filename is in the base (which is not quoted).

	"""
	if time is None: time = Time.prevtime
	addtostr = lambda s: "%s.%s.%s" % (s, Time.timetostring(time), typestr)
	if rp.index:
		incrp = rp.__class__(rp.conn, rp.base, rp.index[:-1] +
							 (addtostr(rp.index[-1]),))
	else:
		dirname, basename = rp.dirsplit()
		incrp = rp.__class__(rp.conn, dirname, (addtostr(basename),))
	assert not incrp.lstat(), incrp
	return incrp
开发者ID:Christoph-D,项目名称:rdiff-backup,代码行数:19,代码来源:increment.py

示例3: recreate_meta

# 需要导入模块: import Time [as 别名]
# 或者: from Time import timetostring [as 别名]
def recreate_meta(meta_manager):
	"""Make regress_time mirror_metadata snapshot by patching

	We write to a tempfile first.  Otherwise, in case of a crash, it
	would seem we would have an intact snapshot and partial diff, not
	the reverse.

	"""
	temprp = [TempFile.new_in_dir(Globals.rbdir)]
	def callback(rp): temprp[0] = rp
	writer = metadata.MetadataFile(temprp[0], 'w', check_path = 0, callback = callback)
	for rorp in meta_manager.get_meta_at_time(regress_time, None):
		writer.write_object(rorp)
	writer.close()

	finalrp = Globals.rbdir.append("mirror_metadata.%s.snapshot.gz" %
								   Time.timetostring(regress_time))
	assert not finalrp.lstat(), finalrp
	rpath.rename(temprp[0], finalrp)
	if Globals.fsync_directories: Globals.rbdir.fsync()
开发者ID:Christoph-D,项目名称:rdiff-backup,代码行数:22,代码来源:regress.py


注:本文中的Time.timetostring方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。