Don't clear file first when saving config file
This commit is contained in:
		
							parent
							
								
									f0b0a31baf
								
							
						
					
					
						commit
						e6410c067b
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		|  | @ -27,8 +27,11 @@ class MuJsonLoader(object): | |||
| 	def save(self, path): | ||||
| 		if self.json: | ||||
| 			output = json.dumps(self.json, sort_keys=True, indent=4, separators=(',', ': ')) | ||||
| 			with open(path, 'wb') as f: | ||||
| 			with open(path, 'a'): | ||||
| 				pass | ||||
| 			with open(path, 'r+') as f: | ||||
| 				f.write(output.encode('utf8')) | ||||
| 				f.truncate() | ||||
| 
 | ||||
| 
 | ||||
| class MuMgr(object): | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue