Fix a few coding style nits in Buck build Python scripts

- Prefix regex strings with `r`
- Remove unused imports
- Rename variables and parameters to avoid redefinition of
  built-in types `dir` and `type`

Change-Id: Ia21667b89631c751f241dd6499a2e460e3435697
This commit is contained in:
David Pursehouse
2013-09-26 16:48:27 +09:00
parent d037971f55
commit 6c25ea8fdd
4 changed files with 10 additions and 11 deletions

View File

@@ -28,8 +28,8 @@ war = environ['TMP']
root = war[:war.index('buck-out')]
jars = set()
def link_jars(libs, dir):
makedirs(dir)
def link_jars(libs, directory):
makedirs(directory)
cp = check_output(['buck', 'audit', 'classpath'] + libs)
for j in cp.strip().splitlines():
if j not in jars:
@@ -37,7 +37,7 @@ def link_jars(libs, dir):
n = path.basename(j)
if j.startswith('buck-out/gen/gerrit-'):
n = j.split('/')[2] + '-' + n
symlink(path.join(root, j), path.join(dir, n))
symlink(path.join(root, j), path.join(directory, n))
if args.lib:
link_jars(args.lib, path.join(war, 'WEB-INF', 'lib'))