Lines Matching refs:p
87 p = Params()
101 p.DRY = True
107 p.DIR = a
110 p.EXEC_ZIP = True
115 p.PROPS = args[0]
116 p.DST = args[1]
117 p.SRC = args[2]
119 if not os.path.isfile(p.PROPS):
120 error = "%s is not a file" % p.PROPS
121 if not os.path.isdir(p.SRC):
122 error = "%s is not a directory" % p.SRC
128 return p
132 def parseSrcDir(p, srcdir): argument
148 for ignore in p.IGNORE:
156 copy(p, filepath, pkg)
157 p.CNT_USED += 1
159 p.CNT_NOPKG += 1
161 if not filename in p.IGNORE_DIR:
162 parseSrcDir(p, filepath)
187 def copy(p, filepath, dest_pkg): argument
192 if p.DRY:
194 elif p.zipfile is not None:
195 if p.EXEC_ZIP:
197 dest_path = os.path.join(p.zipfile, arc_path)
204 p.zipfile.write(filepath, arc_path)
221 p = parseArgs(sys.argv)
224 if not p.DRY:
225 if p.EXEC_ZIP:
226 p.zipfile = p.DST + "_temp_dir"
227 if os.path.exists(p.zipfile):
228 shutil.rmtree(p.zipfile)
229 props_dest = os.path.join(p.zipfile, TOP_FOLDER + "/source.properties")
231 shutil.copyfile(p.PROPS, props_dest)
233 p.zipfile = z = zipfile.ZipFile(p.DST, "w", zipfile.ZIP_DEFLATED)
234 z.write(p.PROPS, TOP_FOLDER + "/source.properties")
235 for d in p.DIR.split():
237 parseSrcDir(p, os.path.join(p.SRC, d))
238 if p.EXEC_ZIP and not p.DRY:
240 os.chdir(p.zipfile)
245 shutil.move(os.path.join(p.zipfile, "_temp.zip"), p.DST)
246 shutil.rmtree(p.zipfile)
250 print "%s: %d java files copied" % (p.DST, p.CNT_USED)
251 if p.CNT_NOPKG:
252 print "%s: %d java files ignored" % (p.DST, p.CNT_NOPKG)
253 if p.DRY: