Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Commit

Permalink
Import localpaths in __init__, avoiding the need to import elsewhere
Browse files Browse the repository at this point in the history
This fixes ./manifest for people who don't have six installed.
  • Loading branch information
gsnedders committed Sep 6, 2016
1 parent 9a344e6 commit ec892f5
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 9 deletions.
1 change: 1 addition & 0 deletions __init__.py
@@ -0,0 +1 @@
from . import localpaths as _localpaths
3 changes: 1 addition & 2 deletions lint/lint.py
Expand Up @@ -12,7 +12,7 @@

from collections import defaultdict

from .. import localpaths
from ..localpaths import repo_root

from manifest.sourcefile import SourceFile
from six import iteritems
Expand Down Expand Up @@ -355,7 +355,6 @@ def parse_args():
return parser.parse_args()

def main():
repo_root = localpaths.repo_root
args = parse_args()
paths = args.paths if args.paths else all_git_paths(repo_root)
return lint(repo_root, paths, args.json)
Expand Down
3 changes: 0 additions & 3 deletions manifest/sourcefile.py
Expand Up @@ -7,9 +7,6 @@
except ImportError:
from xml.etree import ElementTree

here = os.path.dirname(__file__)
localpaths = imp.load_source("localpaths", os.path.abspath(os.path.join(here, os.pardir, "localpaths.py")))

import html5lib

from . import vcs
Expand Down
1 change: 0 additions & 1 deletion manifest/update.py
Expand Up @@ -10,7 +10,6 @@
from .tree import GitTree, NoVCSTree

here = os.path.dirname(__file__)
localpaths = imp.load_source("localpaths", os.path.abspath(os.path.join(here, os.pardir, "localpaths.py")))

def update(tests_root, url_base, manifest, ignore_local=False):
if vcs.is_git_repo(tests_root):
Expand Down
4 changes: 1 addition & 3 deletions serve/serve.py
Expand Up @@ -16,16 +16,14 @@
from collections import defaultdict, OrderedDict
from multiprocessing import Process, Event

from .. import localpaths
from ..localpaths import repo_root

import sslutils
from wptserve import server as wptserve, handlers
from wptserve import stash
from wptserve.logger import set_logger
from mod_pywebsocket import standalone as pywebsocket

repo_root = localpaths.repo_root

def replace_end(s, old, new):
"""
Given a string `s` that ends with `old`, replace that occurrence of `old`
Expand Down

0 comments on commit ec892f5

Please sign in to comment.