mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +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
25
pe/qt/app.py
25
pe/qt/app.py
@ -12,7 +12,7 @@ import os.path as op
|
|||||||
from PyQt4.QtGui import QImage
|
from PyQt4.QtGui import QImage
|
||||||
import PIL.Image
|
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 hsutil.str import get_file_ext
|
||||||
|
|
||||||
from dupeguru_pe import data as data_pe
|
from dupeguru_pe import data as data_pe
|
||||||
@ -27,27 +27,16 @@ from preferences import Preferences
|
|||||||
from preferences_dialog import PreferencesDialog
|
from preferences_dialog import PreferencesDialog
|
||||||
|
|
||||||
class File(phys.File):
|
class File(phys.File):
|
||||||
cls_info_map = {
|
INITIAL_INFO = phys.File.INITIAL_INFO.copy()
|
||||||
'size': IT_ATTRS,
|
INITIAL_INFO.update({
|
||||||
'ctime': IT_ATTRS,
|
|
||||||
'mtime': IT_ATTRS,
|
|
||||||
'md5': IT_MD5,
|
|
||||||
'md5partial': IT_MD5,
|
|
||||||
'dimensions': IT_EXTRA,
|
|
||||||
}
|
|
||||||
|
|
||||||
def _initialize_info(self, section):
|
|
||||||
super(File, self)._initialize_info(section)
|
|
||||||
if section == IT_EXTRA:
|
|
||||||
self._info.update({
|
|
||||||
'dimensions': (0,0),
|
'dimensions': (0,0),
|
||||||
})
|
})
|
||||||
|
|
||||||
def _read_info(self, section):
|
def _read_info(self, field):
|
||||||
super(File, self)._read_info(section)
|
super(File, self)._read_info(field)
|
||||||
if section == IT_EXTRA:
|
if field == 'dimensions':
|
||||||
im = PIL.Image.open(unicode(self.path))
|
im = PIL.Image.open(unicode(self.path))
|
||||||
self._info['dimensions'] = im.size
|
self.dimensions = im.size
|
||||||
|
|
||||||
def get_blocks(self, block_count_per_side):
|
def get_blocks(self, block_count_per_side):
|
||||||
image = QImage(unicode(self.path))
|
image = QImage(unicode(self.path))
|
||||||
|
17
pe/qt/gen.py
17
pe/qt/gen.py
@ -11,9 +11,11 @@
|
|||||||
import os
|
import os
|
||||||
import os.path as op
|
import os.path as op
|
||||||
|
|
||||||
def print_and_do(cmd):
|
from hsutil.build import print_and_do, build_all_qt_ui
|
||||||
print cmd
|
|
||||||
os.system(cmd)
|
build_all_qt_ui(op.join('qtlib', 'ui'))
|
||||||
|
build_all_qt_ui('base')
|
||||||
|
build_all_qt_ui('.')
|
||||||
|
|
||||||
def move(src, dst):
|
def move(src, dst):
|
||||||
if not op.exists(src):
|
if not op.exists(src):
|
||||||
@ -27,19 +29,14 @@ os.chdir('dupeguru_pe')
|
|||||||
print_and_do('python gen.py')
|
print_and_do('python gen.py')
|
||||||
os.chdir('..')
|
os.chdir('..')
|
||||||
|
|
||||||
os.chdir('base')
|
# The CC=gcc-4.0 thing is because, in Snow Leopard, gcc-4.2 can't compile these units.
|
||||||
print_and_do('python gen.py')
|
os.environ['CC'] = 'gcc-4.0'
|
||||||
os.chdir('..')
|
|
||||||
|
|
||||||
os.chdir(op.join('modules', 'block'))
|
os.chdir(op.join('modules', 'block'))
|
||||||
os.system('python setup.py build_ext --inplace')
|
os.system('python setup.py build_ext --inplace')
|
||||||
os.chdir(op.join('..', '..'))
|
os.chdir(op.join('..', '..'))
|
||||||
move(op.join('modules', 'block', '_block.so'), op.join('.', '_block.so'))
|
move(op.join('modules', 'block', '_block.so'), op.join('.', '_block.so'))
|
||||||
move(op.join('modules', 'block', '_block.pyd'), op.join('.', '_block.pyd'))
|
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')
|
os.chdir('help')
|
||||||
print_and_do('python gen.py')
|
print_and_do('python gen.py')
|
||||||
os.chdir('..')
|
os.chdir('..')
|
Loading…
x
Reference in New Issue
Block a user