def reload_scripts(self, subcall=None): """ Return list with single loaded file """ res = [] if subcall: subcall((0, 1)) try: script = Script() script.load_file(self.path) res = [script] except ScriptParseException: pass if subcall: subcall((1, 1)) return res
def reload_scripts(self, subcall = None): """ Return list with single loaded file """ res = [] if subcall: subcall((0, 1)) try: script = Script() script.load_file(self.path) res = [script] except ScriptParseException: pass if subcall: subcall((1,1)) return res
def reload_scripts(self, subcall=None): """ Return list with single downloaded and installed file """ script = None if subcall: subcall((0, 1)) data = self.config.download(self.path) if not data: return [] name = urlparse(self.path)[2].split('/')[-1] installed_path = self.config.install_script(name, data) if installed_path: script = Script() script.load_file(installed_path) script.url = self.path if subcall: subcall((1, 1)) if not script: return [] return [script]
def reload_scripts(self, subcall=None): """ Return list of parsed script files from directory """ res = [] filelist = [x for x in get_file_list(self.path) if x.endswith('.nse')] for i, name in enumerate(filelist): if subcall: subcall((i, len(filelist))) fullname = os.path.join(self.path, name) try: script = Script() script.load_file(fullname) res.append(script) except ScriptParseException: pass if subcall: subcall((len(filelist), len(filelist))) return res
def reload_scripts(self, subcall = None): """ Return list with single downloaded and installed file """ script = None if subcall: subcall((0, 1)) data = self.config.download(self.path) if not data: return [] name = urlparse(self.path)[2].split('/')[-1] installed_path = self.config.install_script(name, data) if installed_path: script = Script() script.load_file(installed_path) script.url = self.path if subcall: subcall((1, 1)) if not script: return [] return [script]
def reload_scripts(self, subcall = None): """ Return list of parsed script files from directory """ res = [] filelist = [x for x in get_file_list(self.path) if x.endswith('.nse')] for i, name in enumerate(filelist): if subcall: subcall((i, len(filelist))) fullname = os.path.join(self.path, name) try: script = Script() script.load_file(fullname) res.append(script) except ScriptParseException: pass if subcall: subcall((len(filelist), len(filelist))) return res