def write_script(self, script_name, contents, mode="t", *ignored): i = contents.find('__requires__') if i >= 0: j = contents.rfind('\n', 0, i) if j >= 0: contents = contents[:j+1] + "import sys\nsys.path.insert(0,'{}')\n".format(gemBS_install_dir) + contents[j+1:] _install_scripts.write_script(self, script_name, contents, mode, *ignored)
def write_script(self, script_name, contents, mode="t", *ignored): shebang = str(contents.splitlines()[0]) if shebang.startswith('#!') and ' ' in shebang[2:].strip() \ and '"' not in shebang: quoted_shebang = '#!"%s"' % shebang[2:].strip() contents = contents.replace(shebang, quoted_shebang) install_scripts.write_script(self, script_name, contents, mode, *ignored)
def write_script(self, script_name, contents, mode="t", *ignored): contents = re.sub("import sys", "import sys\nsys.path.append('/opt/graphite/lib')", contents) install_scripts.write_script(self, script_name, contents, mode="t", *ignored)
def write_script(self, script_name, contents, mode="t", *ignored): contents = re.sub("import sys", "import sys\nsys.path.append('/opt/graphite-storage/lib')", contents) install_scripts.write_script(self, script_name, contents, mode="t", *ignored)
def write_script(self, script_name, script, mode="t", blockers=()): script_name, script = self.transform_script(script_name, script) _install_scripts.write_script(self, script_name, script, mode, blockers)