Bug 1147283 - Replace mozpack.path with mozpath. r=mshal

Back when mozpack.path was added, it was used as:

  import mozpack.path
  mozpack.path.func()

Nowadays, the common idiom is:

  import mozpack.path as mozpath
  mozpath.func()

because it's shorter.

$ git grep mozpath\\. | wc -l
423
$ git grep mozpack.path\\. | wc -l
123

This change was done with:
$ git grep -l mozpack.path\\. | xargs sed -i 's/mozpack\.path\./mozpath./g'
$ git grep -l 'import mozpack.path$' | xargs sed -i 's/import mozpack.path$/\0 as mozpath/'
$ (pat='import mozpack.path as mozpath'; git grep -l "$pat" | xargs sed -i "1,/$pat/b;/$pat/d")
This commit is contained in:
Mike Hommey
2015-03-25 15:05:28 +09:00
parent 969d697ade
commit 2e51d2ef87
23 changed files with 138 additions and 141 deletions

View File

@@ -174,7 +174,7 @@ class UUIDProvider(object):
import os
import xpidl
from mozpack.files import FileFinder
import mozpack.path
import mozpack.path as mozpath
from tempfile import mkdtemp
finder = FileFinder(path, find_executables=False)
@@ -184,7 +184,7 @@ class UUIDProvider(object):
parser = xpidl.IDLParser(outputdir=tmpdir)
registry = InterfaceRegistry()
for p, f in finder.find('**/*.idl'):
p = mozpack.path.join(path, p)
p = mozpath.join(path, p)
try:
content = f.open().read()
idl = parser.parse(content, filename=p)