Lines Matching refs:p
71 p = Params()
84 p.DRY = True
86 p.DIR = a
91 p.SRC = args[0]
92 p.DST = args[1]
94 if not os.path.isdir(p.SRC):
95 error = "%s is not a directory" % p.SRC
96 elif not os.path.isdir(p.DST):
97 error = "%s is not a directory" % p.DST
103 return p
107 def parseSrcDir(p, srcdir): argument
118 copy(p, fp, f, pkg)
119 p.CNT_USED += 1 # one more copied
121 p.CNT_NOPKG += 1 # this java file lacked a package declaration
123 parseSrcDir(p, fp)
148 def copy(p, fp, f, pkg): argument
149 dstdir = os.path.join(p.DST, pkg)
150 _mkdir(p, dstdir)
151 _cp(p, fp, os.path.join(dstdir, f))
154 def _mkdir(p, dir): argument
156 if p.DRY:
162 def _cp(p, src, dst): argument
163 if p.DRY:
170 p = parseArgs(sys.argv)
171 for d in p.DIR.split():
173 parseSrcDir(p, os.path.join(p.SRC, d))
174 print "%d java files copied" % p.CNT_USED
175 if p.CNT_NOPKG: print "%d java files ignored (no package)" % p.CNT_NOPKG
176 if p.DRY: print "This was in *DRY* mode. No copies done."