mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-30 19:00:09 +00:00 
			
		
		
		
	now why is UUID is not serializable to json... JUST HATE IT WHEN PYTHON DOES THINGS LIKE THESE\!
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									0014af5b82
								
							
						
					
					
						commit
						5eca4798a5
					
				
							
								
								
									
										11
									
								
								index.py
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								index.py
									
									
									
									
									
								
							| @ -1,7 +1,7 @@ | |||||||
| #======================================================================= | #======================================================================= | ||||||
| 
 | 
 | ||||||
| __version__ = '''0.0.01''' | __version__ = '''0.0.01''' | ||||||
| __sub_version__ = '''20111110194648''' | __sub_version__ = '''20111110194845''' | ||||||
| __copyright__ = '''(c) Alex A. Naanou 2011''' | __copyright__ = '''(c) Alex A. Naanou 2011''' | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -202,7 +202,7 @@ def split_images(index): | |||||||
| 			for path in raw: | 			for path in raw: | ||||||
| 				##!!! | 				##!!! | ||||||
| 				res += [{ | 				res += [{ | ||||||
| 					'gid': uuid.uuid4(), | 					'gid': str(uuid.uuid4()), | ||||||
| 					'name': name, | 					'name': name, | ||||||
| 					'raw': [path], | 					'raw': [path], | ||||||
| 				}] | 				}] | ||||||
| @ -244,7 +244,7 @@ def split_images(index): | |||||||
| 			for e in res: | 			for e in res: | ||||||
| 				yield e['gid'], e | 				yield e['gid'], e | ||||||
| 		else: | 		else: | ||||||
| 			gid = data['gid'] = uuid.uuid4() | 			gid = data['gid'] = str(uuid.uuid4()) | ||||||
| 			yield gid, data | 			yield gid, data | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -259,12 +259,13 @@ if __name__ == '__main__': | |||||||
| 
 | 
 | ||||||
| 	print len(index) | 	print len(index) | ||||||
| 
 | 
 | ||||||
| 	json.dump(index, file(os.path.join('test', 'filelist.json'), 'w')) |  | ||||||
| 
 |  | ||||||
| 	index = list(split_images(index_by_name(list_files(config['ARCHIVE_ROOT'])))) | 	index = list(split_images(index_by_name(list_files(config['ARCHIVE_ROOT'])))) | ||||||
| 
 | 
 | ||||||
| 	print len(index) | 	print len(index) | ||||||
| 
 | 
 | ||||||
|  | 	json.dump(index, file(os.path.join('test', 'filelist.json'), 'w')) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| #======================================================================= | #======================================================================= | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user