file:///home/developper/svn/phpcompta/branches/rel510 ........ r3268 | danydb | 2010-06-03 00:41:59 +0200 (Thu, 03 Jun 2010) | 1 line Add script for creating class based on a table ........ r3269 | danydb | 2010-06-03 00:42:51 +0200 (Thu, 03 Jun 2010) | 1 line Add script for creating class based on a table ........ r3271 | danydb | 2010-06-03 22:01:05 +0200 (Thu, 03 Jun 2010) | 10 lines remove obsolete comment ======================= include/class_lettering.php Improve generation of PHP Class for a table =========================================== dev/create_phpclass.py dev/create_file_table.sql ........ r3272 | danydb | 2010-06-03 22:30:59 +0200 (Thu, 03 Jun 2010) | 2 lines remove obsolete ........ r3273 | danydb | 2010-06-03 22:38:28 +0200 (Thu, 03 Jun 2010) | 1 line create_phpclass.php improve it ........ r3274 | danydb | 2010-06-04 01:06:20 +0200 (Fri, 04 Jun 2010) | 2 lines create_phpclass : add insert, new comment, fix load function ........ r3275 | danydb | 2010-06-04 14:02:59 +0200 (Fri, 04 Jun 2010) | 1 line add doc ........ r3276 | danydb | 2010-06-04 14:44:55 +0200 (Fri, 04 Jun 2010) | 1 line Generate child object ........ r3277 | danydb | 2010-06-09 15:57:54 +0200 (Wed, 09 Jun 2010) | 1 line Remove useless transform.py ........ r3278 | danydb | 2010-06-09 15:58:26 +0200 (Wed, 09 Jun 2010) | 1 line Housekeeping : create subfolders ........
49 lines
1.3 KiB
Python
Executable file
49 lines
1.3 KiB
Python
Executable file
#!/usr/bin/python
|
|
# Check if the files in include are still used
|
|
#
|
|
# This file is a part of PhpCompta under GPL
|
|
# Author D. DE BONTRIDDER ddebontridder@yahoo.fr
|
|
from transform import *
|
|
import sys
|
|
import os
|
|
import glob
|
|
if len(sys.argv) < 2 :
|
|
print "you need at least two arguments : the file name and the files "
|
|
print " into you look"
|
|
sys.exit(3)
|
|
|
|
filenames=glob.glob(sys.argv[1])
|
|
if len(filenames) == 0:
|
|
filenames=[]
|
|
filenames.append(sys.argv[1])
|
|
print str(filenames)+ "<-"+sys.argv[1]
|
|
for f in filenames:
|
|
file_usage=[]
|
|
filename=os.path.basename(f)
|
|
|
|
for a in range(2,len(sys.argv)):
|
|
files=glob.glob(sys.argv[a])
|
|
print str(a)+" : "+sys.argv[a]
|
|
reFunction=re.compile(filename)
|
|
#reFunction=re.compile('(require|include|form).*'+filename,re.IGNORECASE)
|
|
for file in files:
|
|
#print "Working on file "+file
|
|
fold=open(file)
|
|
lines=fold.readlines()
|
|
for line in lines:
|
|
found=reFunction.findall(line)
|
|
if len(found) != 0 :
|
|
tmp={file:filename}
|
|
file_usage.append(tmp)
|
|
|
|
fold.close()
|
|
#print 'finished, remaining %d' % (total)
|
|
#print file_usage
|
|
#print "lenght "+str(len(file_usage))
|
|
if len (file_usage) > 0 :
|
|
print "This file "+filename+" is used in "
|
|
for x in file_usage:
|
|
print x.keys()[0]
|
|
else:
|
|
print filename +" is never used "
|
|
|