def _gen_lexres_candidate_paths(self, lang): if is_source_tree_layout(): # Look for a lexres path in a local luddite build. udl_dir = dirname(dirname(__file__)) yield join(udl_dir, "build", lang, "lexers", lang + ".lexres") # Look in the Komodo-devel build tree. ko_dir = dirname(dirname(udl_dir)) yield join(ko_dir, "build", "release", "udl", "build", lang, "lexers", lang + ".lexres") # We are an installed Komodo SDK layout or in the Komodo build # $MOZ_OBJDIR. else: import koextlib ko_info = koextlib.KomodoInfo() for ext_dir in ko_info.ext_dirs: yield join(ext_dir, "lexers", lang + ".lexres")
def _gen_lexres_candidate_paths(self, lang): if is_source_tree_layout(): # Look for a lexres path in a local luddite build. udl_dir = dirname(dirname(__file__)) yield join(udl_dir, "build", lang, "lexers", lang+".lexres") # Look in the Komodo-devel build tree. ko_dir = dirname(dirname(udl_dir)) yield join(ko_dir, "build", "release", "udl", "build", lang, "lexers", lang+".lexres") # We are an installed Komodo SDK layout or in the Komodo build # $MOZ_OBJDIR. else: import koextlib ko_info = koextlib.KomodoInfo() for ext_dir in ko_info.ext_dirs: yield join(ext_dir, "lexers", lang+".lexres")
def _add_libs(): """Get a SilverCity build on sys.path. Get Komodo's 'styles.py' on sys.path. """ # Must be using the same Python version as Komodo's internal Python # because SilverCity is a binary ext. assert sys.version_info[:2] == (2, 7), "you must use Python 2.7.x" if is_source_tree_layout(): ko_dev_dir = dirname(dirname(abspath(__file__))) while not exists(join(ko_dev_dir, "Construct")): d = dirname(ko_dev_dir) if d == "ko_dev_dir": raise RuntimeError("couldn't find SilverCity lib") ko_dev_dir = d lib_dirs = [ glob( join(ko_dev_dir, "build", "release", "silvercity", "build", "lib.*"))[0], join(ko_dev_dir, "src", "schemes"), ] else: # in SDK dist_dir = dirname( dirname(dirname(dirname(dirname(abspath(__file__)))))) if exists(join(dist_dir, "bin", "is_dev_tree.txt")): # in a dev build # from: $mozObjDir/dist/komodo-bits/sdk/pylib/ludditelib/debug.py # to: $mozObjDir/dist/bin/python/komodo lib_dirs = [join(dist_dir, "bin", "python", "komodo")] elif sys.platform == "darwin": # in a Komodo install on Mac OS X # from: Contents/SharedSupport/sdk/pylib/ludditelib/debug.py # to: Contents/MacOS/python/komodo lib_dirs = [join(dist_dir, "MacOS", "python", "komodo")] else: # in a Komodo install on Windows or Linux # from: lib/sdk/pylib/ludditelib/debug.py # to: lib/mozilla/python/komodo lib_dirs = [join(dist_dir, "lib", "mozilla", "python", "komodo")] for lib_dir in lib_dirs: sys.path.insert(0, lib_dir)
def _add_libs(): """Get a SilverCity build on sys.path. Get Komodo's 'styles.py' on sys.path. """ # Must be using the same Python version as Komodo's internal Python # because SilverCity is a binary ext. assert sys.version_info[:2] == (2, 7), "you must use Python 2.7.x" if is_source_tree_layout(): ko_dev_dir = dirname(dirname(abspath(__file__))) while not exists(join(ko_dev_dir, "Construct")): d = dirname(ko_dev_dir) if d == "ko_dev_dir": raise RuntimeError("couldn't find SilverCity lib") ko_dev_dir = d lib_dirs = [ glob(join(ko_dev_dir, "build", "release", "silvercity", "build", "lib.*"))[0], join(ko_dev_dir, "src", "schemes"), ] else: # in SDK dist_dir = dirname(dirname(dirname( dirname(dirname(abspath(__file__)))))) if exists(join(dist_dir, "bin", "is_dev_tree.txt")): # in a dev build # from: $mozObjDir/dist/komodo-bits/sdk/pylib/ludditelib/debug.py # to: $mozObjDir/dist/bin/python/komodo lib_dirs = [join(dist_dir, "bin", "python", "komodo")] elif sys.platform == "darwin": # in a Komodo install on Mac OS X # from: Contents/SharedSupport/sdk/pylib/ludditelib/debug.py # to: Contents/MacOS/python/komodo lib_dirs = [join(dist_dir, "MacOS", "python", "komodo")] else: # in a Komodo install on Windows or Linux # from: lib/sdk/pylib/ludditelib/debug.py # to: lib/mozilla/python/komodo lib_dirs = [join(dist_dir, "lib", "mozilla", "python", "komodo")] for lib_dir in lib_dirs: sys.path.insert(0, lib_dir)