示例#1
0
文件: jsondb.py 项目: cungnv/scrapex
	def save(self):
		data = {'keyname': self.keyname, 'rows': self.rows}
		#backup the existing file
		if os.path.exists(self.file_path):
			shutil.copy2(self.file_path, self.file_path+'.bk')
		common.write_json(self.file_path, data)

		
示例#2
0
文件: core.py 项目: igizm0/scrapex
 def write_json(self, filename, data):
     common.write_json(self.join_path(filename), data)
     return self
示例#3
0
 def save(self):
     data = {'keyname': self.keyname, 'rows': self.rows}
     #backup the existing file
     if os.path.exists(self.file_path):
         shutil.copy2(self.file_path, self.file_path + '.bk')
     common.write_json(self.file_path, data)
示例#4
0
文件: core.py 项目: cungnv/scrapex
	def write_json(self, filename, data):
		common.write_json(self.join_path(filename), data)
		return self