Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: mojo/public/tools/mopy/paths.py

Issue 878933003: Move the apptest runner and parts of mopy to the public SDK. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import os 5 import os
6 6
7 from .config import Config 7 from .config import Config
8 from .gn import BuildDirectoryForConfig 8 from .gn import BuildDirectoryForConfig
9 9
10 class Paths(object): 10 class Paths(object):
11 """Provides commonly used paths""" 11 """Provides commonly used paths"""
12 12
13 def __init__(self, config=None, build_dir=None): 13 def __init__(self, config=None, build_dir=None):
14 """Specify either a config or a build_dir to generate paths to binary 14 """Specify either a config or a build_dir to generate paths to binary
15 artifacts.""" 15 artifacts."""
16 self.src_root = os.path.abspath(os.path.join(__file__, 16 self.src_root = os.path.abspath(os.path.join(__file__,
17 os.pardir, os.pardir, os.pardir, os.pardir)) 17 os.pardir, os.pardir, os.pardir, os.pardir, os.pardir))
18 self.mojo_dir = os.path.join(self.src_root, "mojo") 18 self.mojo_dir = os.path.join(self.src_root, "mojo")
19 19
20 if config: 20 if config:
21 self.build_dir = BuildDirectoryForConfig(config, self.src_root) 21 self.build_dir = BuildDirectoryForConfig(config, self.src_root)
22 elif build_dir is not None: 22 elif build_dir is not None:
23 self.build_dir = os.path.abspath(build_dir) 23 self.build_dir = os.path.abspath(build_dir)
24 else: 24 else:
25 self.build_dir = None 25 self.build_dir = None
26 26
27 if self.build_dir is not None: 27 if self.build_dir is not None:
(...skipping 26 matching lines...) Expand all
54 return os.path.join(self.build_dir, name + '.mojo') 54 return os.path.join(self.build_dir, name + '.mojo')
55 return name + '.mojo' 55 return name + '.mojo'
56 56
57 @staticmethod 57 @staticmethod
58 def IsValidAppUrl(url): 58 def IsValidAppUrl(url):
59 """Returns False if url is malformed, True otherwise.""" 59 """Returns False if url is malformed, True otherwise."""
60 try: 60 try:
61 return len(url.split(':')) == 2 61 return len(url.split(':')) == 2
62 except ValueError: 62 except ValueError:
63 return False 63 return False
OLDNEW
« no previous file with comments | « mojo/public/tools/mopy/gtest_list_tests_unittest.py ('k') | mojo/public/tools/mopy/print_process_error.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698