mirror of
				https://github.com/arsenetar/dupeguru.git
				synced 2025-09-11 17:58:17 +00:00 
			
		
		
		
	dgpe qt: adjusted to the latest developements.
--HG-- extra : convert_revision : svn%3Ac306627e-7827-47d3-bdf0-9a457c9553a1/trunk%40148
This commit is contained in:
		
							parent
							
								
									b816955d95
								
							
						
					
					
						commit
						355c617de4
					
				
							
								
								
									
										29
									
								
								pe/qt/app.py
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								pe/qt/app.py
									
									
									
									
									
								
							| @ -12,7 +12,7 @@ import os.path as op | ||||
| from PyQt4.QtGui import QImage | ||||
| import PIL.Image | ||||
| 
 | ||||
| from hsfs import phys, IT_ATTRS, IT_MD5, IT_EXTRA | ||||
| from hsfs import phys | ||||
| from hsutil.str import get_file_ext | ||||
| 
 | ||||
| from dupeguru_pe import data as data_pe | ||||
| @ -27,27 +27,16 @@ from preferences import Preferences | ||||
| from preferences_dialog import PreferencesDialog | ||||
| 
 | ||||
| class File(phys.File): | ||||
|     cls_info_map = { | ||||
|         'size': IT_ATTRS, | ||||
|         'ctime': IT_ATTRS, | ||||
|         'mtime': IT_ATTRS, | ||||
|         'md5': IT_MD5, | ||||
|         'md5partial': IT_MD5, | ||||
|         'dimensions': IT_EXTRA, | ||||
|     } | ||||
|     INITIAL_INFO = phys.File.INITIAL_INFO.copy() | ||||
|     INITIAL_INFO.update({ | ||||
|         'dimensions': (0,0), | ||||
|     }) | ||||
|      | ||||
|     def _initialize_info(self, section): | ||||
|         super(File, self)._initialize_info(section) | ||||
|         if section == IT_EXTRA: | ||||
|             self._info.update({ | ||||
|                 'dimensions': (0,0), | ||||
|             }) | ||||
|      | ||||
|     def _read_info(self, section): | ||||
|         super(File, self)._read_info(section) | ||||
|         if section == IT_EXTRA: | ||||
|     def _read_info(self, field): | ||||
|         super(File, self)._read_info(field) | ||||
|         if field == 'dimensions': | ||||
|             im = PIL.Image.open(unicode(self.path)) | ||||
|             self._info['dimensions'] = im.size | ||||
|             self.dimensions = im.size | ||||
|      | ||||
|     def get_blocks(self, block_count_per_side): | ||||
|         image = QImage(unicode(self.path)) | ||||
|  | ||||
							
								
								
									
										17
									
								
								pe/qt/gen.py
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								pe/qt/gen.py
									
									
									
									
									
								
							| @ -11,9 +11,11 @@ | ||||
| import os | ||||
| import os.path as op | ||||
| 
 | ||||
| def print_and_do(cmd): | ||||
|     print cmd | ||||
|     os.system(cmd) | ||||
| from hsutil.build import print_and_do, build_all_qt_ui | ||||
| 
 | ||||
| build_all_qt_ui(op.join('qtlib', 'ui')) | ||||
| build_all_qt_ui('base') | ||||
| build_all_qt_ui('.') | ||||
| 
 | ||||
| def move(src, dst): | ||||
|     if not op.exists(src): | ||||
| @ -27,19 +29,14 @@ os.chdir('dupeguru_pe') | ||||
| print_and_do('python gen.py') | ||||
| os.chdir('..') | ||||
| 
 | ||||
| os.chdir('base') | ||||
| print_and_do('python gen.py') | ||||
| os.chdir('..') | ||||
| 
 | ||||
| # The CC=gcc-4.0 thing is because, in Snow Leopard, gcc-4.2 can't compile these units. | ||||
| os.environ['CC'] = 'gcc-4.0' | ||||
| os.chdir(op.join('modules', 'block')) | ||||
| os.system('python setup.py build_ext --inplace') | ||||
| os.chdir(op.join('..', '..')) | ||||
| move(op.join('modules', 'block', '_block.so'), op.join('.', '_block.so')) | ||||
| move(op.join('modules', 'block', '_block.pyd'), op.join('.', '_block.pyd')) | ||||
| 
 | ||||
| print_and_do("pyuic4 details_dialog.ui > details_dialog_ui.py") | ||||
| print_and_do("pyuic4 preferences_dialog.ui > preferences_dialog_ui.py") | ||||
| 
 | ||||
| os.chdir('help') | ||||
| print_and_do('python gen.py') | ||||
| os.chdir('..') | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user