mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Warn about PyQt4 sneaking into the code on branch checkout
This commit is contained in:
parent
26136293b7
commit
29fdb8dc62
@ -38,7 +38,14 @@ if flags == '1': # A branch checkout
|
||||
# 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…
x
Reference in New Issue
Block a user