mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-20 21:13:57 +02:00
Warn about PyQt4 sneaking into the code on branch checkout
This commit is contained in:
parent
26136293b7
commit
29fdb8dc62
1 changed files with 8 additions and 1 deletions
|
|
@ -38,7 +38,14 @@ def get_branch_name(rev):
|
|||
# Remove .pyc files as some of them might have been orphaned
|
||||
for dirpath, dirnames, filenames in os.walk('.'):
|
||||
for f in filenames:
|
||||
fpath = os.path.join(dirpath, f)
|
||||
if f.endswith('.pyc'):
|
||||
os.remove(os.path.join(dirpath, f))
|
||||
os.remove(fpath)
|
||||
elif cur_branch == 'qt5' and f.endswith('.py') and 'qtcurve' not in fpath and (b'PyQt' + b'4') in open(fpath, 'rb').read():
|
||||
red = ('\033[%dm'%31).encode('ascii')
|
||||
reset = ('\033[%dm'%31).encode('ascii')
|
||||
sys.stdout.write(red)
|
||||
print ('\nPyQt' + '4 present in:', fpath)
|
||||
sys.stdout.write(reset)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue