[Pymoul-svn] SF.net SVN: pymoul: [33] pymoul/trunk
Status: Alpha
Brought to you by:
tiran
|
From: <ti...@us...> - 2007-01-16 11:16:49
|
Revision: 33
http://pymoul.svn.sourceforge.net/pymoul/?rev=33&view=rev
Author: tiran
Date: 2007-01-16 03:16:50 -0800 (Tue, 16 Jan 2007)
Log Message:
-----------
* Changed compileui.py. It doesn't recompile the files if the orig files are older than the source files
* Ignore eric4 files
Modified Paths:
--------------
pymoul/trunk/compileui.py
Property Changed:
----------------
pymoul/trunk/
Property changes on: pymoul/trunk
___________________________________________________________________
Name: svn:ignore
- build
dist
+ build
dist
*.e4?
Modified: pymoul/trunk/compileui.py
===================================================================
--- pymoul/trunk/compileui.py 2007-01-16 11:13:44 UTC (rev 32)
+++ pymoul/trunk/compileui.py 2007-01-16 11:16:50 UTC (rev 33)
@@ -3,6 +3,7 @@
"""
import os
import re
+from stat import ST_MTIME
from PyQt4 import uic
@@ -16,6 +17,9 @@
QRC_COMPILER = "pyrcc4 -o %(py)s %(qrc)s"
UI_MODULE = "moul.qt.ui"
+def _newer(orig, py):
+ return os.stat(orig)[ST_MTIME] > os.stat(py)[ST_MTIME]
+
def previewUi(uifname):
"""Copied from PyQt.uic.pyuic
"""
@@ -46,6 +50,8 @@
py_name = ui_name.lower()[:-len(UI_EXT)]+PY_EXT
ui_path = os.path.join(root, ui_name)
py_path = os.path.join(root, py_name)
+ if not _newer(ui_path, py_path):
+ continue
ui = open(ui_path, 'r')
py = open(py_path, 'w')
err = uic.compileUi(ui, py, execute)
@@ -63,7 +69,6 @@
lines = []
fin = open(fname, 'r')
for line in fin:
-
if line.startswith('import'):
# faster than re
match = RE_RC.match(line)
@@ -82,6 +87,8 @@
kw = {}
kw['qrc'] = os.path.join(root, qrc_name)
kw['py'] = os.path.join(root, py_name)
+ if not _newer(kw['qrc'], kw['py']):
+ continue
err = os.system(QRC_COMPILER % kw)
if err != 0:
raise RuntimeError("pyrcc error")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|