repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
adamrehn/ue4cli
ue4cli/Utility.py
Utility.findArgs
def findArgs(args, prefixes): """ Extracts the list of arguments that start with any of the specified prefix values """ return list([ arg for arg in args if len([p for p in prefixes if arg.lower().startswith(p.lower())]) > 0 ])
python
def findArgs(args, prefixes): """ Extracts the list of arguments that start with any of the specified prefix values """ return list([ arg for arg in args if len([p for p in prefixes if arg.lower().startswith(p.lower())]) > 0 ])
[ "def", "findArgs", "(", "args", ",", "prefixes", ")", ":", "return", "list", "(", "[", "arg", "for", "arg", "in", "args", "if", "len", "(", "[", "p", "for", "p", "in", "prefixes", "if", "arg", ".", "lower", "(", ")", ".", "startswith", "(", "p", ...
Extracts the list of arguments that start with any of the specified prefix values
[ "Extracts", "the", "list", "of", "arguments", "that", "start", "with", "any", "of", "the", "specified", "prefix", "values" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/Utility.py#L86-L93
adamrehn/ue4cli
ue4cli/Utility.py
Utility.stripArgs
def stripArgs(args, blacklist): """ Removes any arguments in the supplied list that are contained in the specified blacklist """ blacklist = [b.lower() for b in blacklist] return list([arg for arg in args if arg.lower() not in blacklist])
python
def stripArgs(args, blacklist): """ Removes any arguments in the supplied list that are contained in the specified blacklist """ blacklist = [b.lower() for b in blacklist] return list([arg for arg in args if arg.lower() not in blacklist])
[ "def", "stripArgs", "(", "args", ",", "blacklist", ")", ":", "blacklist", "=", "[", "b", ".", "lower", "(", ")", "for", "b", "in", "blacklist", "]", "return", "list", "(", "[", "arg", "for", "arg", "in", "args", "if", "arg", ".", "lower", "(", ")...
Removes any arguments in the supplied list that are contained in the specified blacklist
[ "Removes", "any", "arguments", "in", "the", "supplied", "list", "that", "are", "contained", "in", "the", "specified", "blacklist" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/Utility.py#L103-L108
adamrehn/ue4cli
ue4cli/Utility.py
Utility.capture
def capture(command, input=None, cwd=None, shell=False, raiseOnError=False): """ Executes a child process and captures its output """ # Attempt to execute the child process proc = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd, shell=shell, universa...
python
def capture(command, input=None, cwd=None, shell=False, raiseOnError=False): """ Executes a child process and captures its output """ # Attempt to execute the child process proc = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd, shell=shell, universa...
[ "def", "capture", "(", "command", ",", "input", "=", "None", ",", "cwd", "=", "None", ",", "shell", "=", "False", ",", "raiseOnError", "=", "False", ")", ":", "# Attempt to execute the child process", "proc", "=", "subprocess", ".", "Popen", "(", "command", ...
Executes a child process and captures its output
[ "Executes", "a", "child", "process", "and", "captures", "its", "output" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/Utility.py#L111-L129
adamrehn/ue4cli
ue4cli/Utility.py
Utility.run
def run(command, cwd=None, shell=False, raiseOnError=False): """ Executes a child process and waits for it to complete """ returncode = subprocess.call(command, cwd=cwd, shell=shell) if raiseOnError == True and returncode != 0: raise Exception('child process ' + str(command) + ' failed with exit code ' + s...
python
def run(command, cwd=None, shell=False, raiseOnError=False): """ Executes a child process and waits for it to complete """ returncode = subprocess.call(command, cwd=cwd, shell=shell) if raiseOnError == True and returncode != 0: raise Exception('child process ' + str(command) + ' failed with exit code ' + s...
[ "def", "run", "(", "command", ",", "cwd", "=", "None", ",", "shell", "=", "False", ",", "raiseOnError", "=", "False", ")", ":", "returncode", "=", "subprocess", ".", "call", "(", "command", ",", "cwd", "=", "cwd", ",", "shell", "=", "shell", ")", "...
Executes a child process and waits for it to complete
[ "Executes", "a", "child", "process", "and", "waits", "for", "it", "to", "complete" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/Utility.py#L132-L139
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.setEngineRootOverride
def setEngineRootOverride(self, rootDir): """ Sets a user-specified directory as the root engine directory, overriding any auto-detection """ # Set the new root directory ConfigurationManager.setConfigKey('rootDirOverride', os.path.abspath(rootDir)) # Check that the specified directory is valid and ...
python
def setEngineRootOverride(self, rootDir): """ Sets a user-specified directory as the root engine directory, overriding any auto-detection """ # Set the new root directory ConfigurationManager.setConfigKey('rootDirOverride', os.path.abspath(rootDir)) # Check that the specified directory is valid and ...
[ "def", "setEngineRootOverride", "(", "self", ",", "rootDir", ")", ":", "# Set the new root directory", "ConfigurationManager", ".", "setConfigKey", "(", "'rootDirOverride'", ",", "os", ".", "path", ".", "abspath", "(", "rootDir", ")", ")", "# Check that the specified ...
Sets a user-specified directory as the root engine directory, overriding any auto-detection
[ "Sets", "a", "user", "-", "specified", "directory", "as", "the", "root", "engine", "directory", "overriding", "any", "auto", "-", "detection" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L33-L45
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.getEngineRoot
def getEngineRoot(self): """ Returns the root directory location of the latest installed version of UE4 """ if not hasattr(self, '_engineRoot'): self._engineRoot = self._getEngineRoot() return self._engineRoot
python
def getEngineRoot(self): """ Returns the root directory location of the latest installed version of UE4 """ if not hasattr(self, '_engineRoot'): self._engineRoot = self._getEngineRoot() return self._engineRoot
[ "def", "getEngineRoot", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'_engineRoot'", ")", ":", "self", ".", "_engineRoot", "=", "self", ".", "_getEngineRoot", "(", ")", "return", "self", ".", "_engineRoot" ]
Returns the root directory location of the latest installed version of UE4
[ "Returns", "the", "root", "directory", "location", "of", "the", "latest", "installed", "version", "of", "UE4" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L53-L59
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.getEngineVersion
def getEngineVersion(self, outputFormat = 'full'): """ Returns the version number of the latest installed version of UE4 """ version = self._getEngineVersionDetails() formats = { 'major': version['MajorVersion'], 'minor': version['MinorVersion'], 'patch': version['PatchVersion'], 'full': '{}.{}.{}...
python
def getEngineVersion(self, outputFormat = 'full'): """ Returns the version number of the latest installed version of UE4 """ version = self._getEngineVersionDetails() formats = { 'major': version['MajorVersion'], 'minor': version['MinorVersion'], 'patch': version['PatchVersion'], 'full': '{}.{}.{}...
[ "def", "getEngineVersion", "(", "self", ",", "outputFormat", "=", "'full'", ")", ":", "version", "=", "self", ".", "_getEngineVersionDetails", "(", ")", "formats", "=", "{", "'major'", ":", "version", "[", "'MajorVersion'", "]", ",", "'minor'", ":", "version...
Returns the version number of the latest installed version of UE4
[ "Returns", "the", "version", "number", "of", "the", "latest", "installed", "version", "of", "UE4" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L61-L78
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.getEngineChangelist
def getEngineChangelist(self): """ Returns the compatible Perforce changelist identifier for the latest installed version of UE4 """ # Newer versions of the engine use the key "CompatibleChangelist", older ones use "Changelist" version = self._getEngineVersionDetails() if 'CompatibleChangelist' in versio...
python
def getEngineChangelist(self): """ Returns the compatible Perforce changelist identifier for the latest installed version of UE4 """ # Newer versions of the engine use the key "CompatibleChangelist", older ones use "Changelist" version = self._getEngineVersionDetails() if 'CompatibleChangelist' in versio...
[ "def", "getEngineChangelist", "(", "self", ")", ":", "# Newer versions of the engine use the key \"CompatibleChangelist\", older ones use \"Changelist\"", "version", "=", "self", ".", "_getEngineVersionDetails", "(", ")", "if", "'CompatibleChangelist'", "in", "version", ":", "r...
Returns the compatible Perforce changelist identifier for the latest installed version of UE4
[ "Returns", "the", "compatible", "Perforce", "changelist", "identifier", "for", "the", "latest", "installed", "version", "of", "UE4" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L80-L90
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.isInstalledBuild
def isInstalledBuild(self): """ Determines if the Engine is an Installed Build """ sentinelFile = os.path.join(self.getEngineRoot(), 'Engine', 'Build', 'InstalledBuild.txt') return os.path.exists(sentinelFile)
python
def isInstalledBuild(self): """ Determines if the Engine is an Installed Build """ sentinelFile = os.path.join(self.getEngineRoot(), 'Engine', 'Build', 'InstalledBuild.txt') return os.path.exists(sentinelFile)
[ "def", "isInstalledBuild", "(", "self", ")", ":", "sentinelFile", "=", "os", ".", "path", ".", "join", "(", "self", ".", "getEngineRoot", "(", ")", ",", "'Engine'", ",", "'Build'", ",", "'InstalledBuild.txt'", ")", "return", "os", ".", "path", ".", "exis...
Determines if the Engine is an Installed Build
[ "Determines", "if", "the", "Engine", "is", "an", "Installed", "Build" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L92-L97
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.getEditorBinary
def getEditorBinary(self, cmdVersion=False): """ Determines the location of the UE4Editor binary """ return os.path.join(self.getEngineRoot(), 'Engine', 'Binaries', self.getPlatformIdentifier(), 'UE4Editor' + self._editorPathSuffix(cmdVersion))
python
def getEditorBinary(self, cmdVersion=False): """ Determines the location of the UE4Editor binary """ return os.path.join(self.getEngineRoot(), 'Engine', 'Binaries', self.getPlatformIdentifier(), 'UE4Editor' + self._editorPathSuffix(cmdVersion))
[ "def", "getEditorBinary", "(", "self", ",", "cmdVersion", "=", "False", ")", ":", "return", "os", ".", "path", ".", "join", "(", "self", ".", "getEngineRoot", "(", ")", ",", "'Engine'", ",", "'Binaries'", ",", "self", ".", "getPlatformIdentifier", "(", "...
Determines the location of the UE4Editor binary
[ "Determines", "the", "location", "of", "the", "UE4Editor", "binary" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L99-L103
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.getProjectDescriptor
def getProjectDescriptor(self, dir): """ Detects the .uproject descriptor file for the Unreal project in the specified directory """ for project in glob.glob(os.path.join(dir, '*.uproject')): return os.path.realpath(project) # No project detected raise UnrealManagerException('could not detect an Unrea...
python
def getProjectDescriptor(self, dir): """ Detects the .uproject descriptor file for the Unreal project in the specified directory """ for project in glob.glob(os.path.join(dir, '*.uproject')): return os.path.realpath(project) # No project detected raise UnrealManagerException('could not detect an Unrea...
[ "def", "getProjectDescriptor", "(", "self", ",", "dir", ")", ":", "for", "project", "in", "glob", ".", "glob", "(", "os", ".", "path", ".", "join", "(", "dir", ",", "'*.uproject'", ")", ")", ":", "return", "os", ".", "path", ".", "realpath", "(", "...
Detects the .uproject descriptor file for the Unreal project in the specified directory
[ "Detects", "the", ".", "uproject", "descriptor", "file", "for", "the", "Unreal", "project", "in", "the", "specified", "directory" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L123-L131
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.getPluginDescriptor
def getPluginDescriptor(self, dir): """ Detects the .uplugin descriptor file for the Unreal plugin in the specified directory """ for plugin in glob.glob(os.path.join(dir, '*.uplugin')): return os.path.realpath(plugin) # No plugin detected raise UnrealManagerException('could not detect an Unreal plugi...
python
def getPluginDescriptor(self, dir): """ Detects the .uplugin descriptor file for the Unreal plugin in the specified directory """ for plugin in glob.glob(os.path.join(dir, '*.uplugin')): return os.path.realpath(plugin) # No plugin detected raise UnrealManagerException('could not detect an Unreal plugi...
[ "def", "getPluginDescriptor", "(", "self", ",", "dir", ")", ":", "for", "plugin", "in", "glob", ".", "glob", "(", "os", ".", "path", ".", "join", "(", "dir", ",", "'*.uplugin'", ")", ")", ":", "return", "os", ".", "path", ".", "realpath", "(", "plu...
Detects the .uplugin descriptor file for the Unreal plugin in the specified directory
[ "Detects", "the", ".", "uplugin", "descriptor", "file", "for", "the", "Unreal", "plugin", "in", "the", "specified", "directory" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L133-L141
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.getDescriptor
def getDescriptor(self, dir): """ Detects the descriptor file for either an Unreal project or an Unreal plugin in the specified directory """ try: return self.getProjectDescriptor(dir) except: try: return self.getPluginDescriptor(dir) except: raise UnrealManagerException('could not detect an ...
python
def getDescriptor(self, dir): """ Detects the descriptor file for either an Unreal project or an Unreal plugin in the specified directory """ try: return self.getProjectDescriptor(dir) except: try: return self.getPluginDescriptor(dir) except: raise UnrealManagerException('could not detect an ...
[ "def", "getDescriptor", "(", "self", ",", "dir", ")", ":", "try", ":", "return", "self", ".", "getProjectDescriptor", "(", "dir", ")", "except", ":", "try", ":", "return", "self", ".", "getPluginDescriptor", "(", "dir", ")", "except", ":", "raise", "Unre...
Detects the descriptor file for either an Unreal project or an Unreal plugin in the specified directory
[ "Detects", "the", "descriptor", "file", "for", "either", "an", "Unreal", "project", "or", "an", "Unreal", "plugin", "in", "the", "specified", "directory" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L143-L153
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.listThirdPartyLibs
def listThirdPartyLibs(self, configuration = 'Development'): """ Lists the supported Unreal-bundled third-party libraries """ interrogator = self._getUE4BuildInterrogator() return interrogator.list(self.getPlatformIdentifier(), configuration, self._getLibraryOverrides())
python
def listThirdPartyLibs(self, configuration = 'Development'): """ Lists the supported Unreal-bundled third-party libraries """ interrogator = self._getUE4BuildInterrogator() return interrogator.list(self.getPlatformIdentifier(), configuration, self._getLibraryOverrides())
[ "def", "listThirdPartyLibs", "(", "self", ",", "configuration", "=", "'Development'", ")", ":", "interrogator", "=", "self", ".", "_getUE4BuildInterrogator", "(", ")", "return", "interrogator", ".", "list", "(", "self", ".", "getPlatformIdentifier", "(", ")", ",...
Lists the supported Unreal-bundled third-party libraries
[ "Lists", "the", "supported", "Unreal", "-", "bundled", "third", "-", "party", "libraries" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L173-L178
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.getThirdpartyLibs
def getThirdpartyLibs(self, libs, configuration = 'Development', includePlatformDefaults = True): """ Retrieves the ThirdPartyLibraryDetails instance for Unreal-bundled versions of the specified third-party libraries """ if includePlatformDefaults == True: libs = self._defaultThirdpartyLibs() + libs interr...
python
def getThirdpartyLibs(self, libs, configuration = 'Development', includePlatformDefaults = True): """ Retrieves the ThirdPartyLibraryDetails instance for Unreal-bundled versions of the specified third-party libraries """ if includePlatformDefaults == True: libs = self._defaultThirdpartyLibs() + libs interr...
[ "def", "getThirdpartyLibs", "(", "self", ",", "libs", ",", "configuration", "=", "'Development'", ",", "includePlatformDefaults", "=", "True", ")", ":", "if", "includePlatformDefaults", "==", "True", ":", "libs", "=", "self", ".", "_defaultThirdpartyLibs", "(", ...
Retrieves the ThirdPartyLibraryDetails instance for Unreal-bundled versions of the specified third-party libraries
[ "Retrieves", "the", "ThirdPartyLibraryDetails", "instance", "for", "Unreal", "-", "bundled", "versions", "of", "the", "specified", "third", "-", "party", "libraries" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L180-L187
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.getThirdPartyLibCompilerFlags
def getThirdPartyLibCompilerFlags(self, libs): """ Retrieves the compiler flags for building against the Unreal-bundled versions of the specified third-party libraries """ fmt = PrintingFormat.singleLine() if libs[0] == '--multiline': fmt = PrintingFormat.multiLine() libs = libs[1:] platformDefault...
python
def getThirdPartyLibCompilerFlags(self, libs): """ Retrieves the compiler flags for building against the Unreal-bundled versions of the specified third-party libraries """ fmt = PrintingFormat.singleLine() if libs[0] == '--multiline': fmt = PrintingFormat.multiLine() libs = libs[1:] platformDefault...
[ "def", "getThirdPartyLibCompilerFlags", "(", "self", ",", "libs", ")", ":", "fmt", "=", "PrintingFormat", ".", "singleLine", "(", ")", "if", "libs", "[", "0", "]", "==", "'--multiline'", ":", "fmt", "=", "PrintingFormat", ".", "multiLine", "(", ")", "libs"...
Retrieves the compiler flags for building against the Unreal-bundled versions of the specified third-party libraries
[ "Retrieves", "the", "compiler", "flags", "for", "building", "against", "the", "Unreal", "-", "bundled", "versions", "of", "the", "specified", "third", "-", "party", "libraries" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L189-L204
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.getThirdPartyLibLinkerFlags
def getThirdPartyLibLinkerFlags(self, libs): """ Retrieves the linker flags for building against the Unreal-bundled versions of the specified third-party libraries """ fmt = PrintingFormat.singleLine() if libs[0] == '--multiline': fmt = PrintingFormat.multiLine() libs = libs[1:] includeLibs = True ...
python
def getThirdPartyLibLinkerFlags(self, libs): """ Retrieves the linker flags for building against the Unreal-bundled versions of the specified third-party libraries """ fmt = PrintingFormat.singleLine() if libs[0] == '--multiline': fmt = PrintingFormat.multiLine() libs = libs[1:] includeLibs = True ...
[ "def", "getThirdPartyLibLinkerFlags", "(", "self", ",", "libs", ")", ":", "fmt", "=", "PrintingFormat", ".", "singleLine", "(", ")", "if", "libs", "[", "0", "]", "==", "'--multiline'", ":", "fmt", "=", "PrintingFormat", ".", "multiLine", "(", ")", "libs", ...
Retrieves the linker flags for building against the Unreal-bundled versions of the specified third-party libraries
[ "Retrieves", "the", "linker", "flags", "for", "building", "against", "the", "Unreal", "-", "bundled", "versions", "of", "the", "specified", "third", "-", "party", "libraries" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L206-L226
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.getThirdPartyLibCmakeFlags
def getThirdPartyLibCmakeFlags(self, libs): """ Retrieves the CMake invocation flags for building against the Unreal-bundled versions of the specified third-party libraries """ fmt = PrintingFormat.singleLine() if libs[0] == '--multiline': fmt = PrintingFormat.multiLine() libs = libs[1:] platformDe...
python
def getThirdPartyLibCmakeFlags(self, libs): """ Retrieves the CMake invocation flags for building against the Unreal-bundled versions of the specified third-party libraries """ fmt = PrintingFormat.singleLine() if libs[0] == '--multiline': fmt = PrintingFormat.multiLine() libs = libs[1:] platformDe...
[ "def", "getThirdPartyLibCmakeFlags", "(", "self", ",", "libs", ")", ":", "fmt", "=", "PrintingFormat", ".", "singleLine", "(", ")", "if", "libs", "[", "0", "]", "==", "'--multiline'", ":", "fmt", "=", "PrintingFormat", ".", "multiLine", "(", ")", "libs", ...
Retrieves the CMake invocation flags for building against the Unreal-bundled versions of the specified third-party libraries
[ "Retrieves", "the", "CMake", "invocation", "flags", "for", "building", "against", "the", "Unreal", "-", "bundled", "versions", "of", "the", "specified", "third", "-", "party", "libraries" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L228-L244
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.getThirdPartyLibIncludeDirs
def getThirdPartyLibIncludeDirs(self, libs): """ Retrieves the list of include directories for building against the Unreal-bundled versions of the specified third-party libraries """ platformDefaults = True if libs[0] == '--nodefaults': platformDefaults = False libs = libs[1:] details = self.getThi...
python
def getThirdPartyLibIncludeDirs(self, libs): """ Retrieves the list of include directories for building against the Unreal-bundled versions of the specified third-party libraries """ platformDefaults = True if libs[0] == '--nodefaults': platformDefaults = False libs = libs[1:] details = self.getThi...
[ "def", "getThirdPartyLibIncludeDirs", "(", "self", ",", "libs", ")", ":", "platformDefaults", "=", "True", "if", "libs", "[", "0", "]", "==", "'--nodefaults'", ":", "platformDefaults", "=", "False", "libs", "=", "libs", "[", "1", ":", "]", "details", "=", ...
Retrieves the list of include directories for building against the Unreal-bundled versions of the specified third-party libraries
[ "Retrieves", "the", "list", "of", "include", "directories", "for", "building", "against", "the", "Unreal", "-", "bundled", "versions", "of", "the", "specified", "third", "-", "party", "libraries" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L246-L256
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.getThirdPartyLibFiles
def getThirdPartyLibFiles(self, libs): """ Retrieves the list of library files for building against the Unreal-bundled versions of the specified third-party libraries """ platformDefaults = True if libs[0] == '--nodefaults': platformDefaults = False libs = libs[1:] details = self.getThirdpartyLibs(...
python
def getThirdPartyLibFiles(self, libs): """ Retrieves the list of library files for building against the Unreal-bundled versions of the specified third-party libraries """ platformDefaults = True if libs[0] == '--nodefaults': platformDefaults = False libs = libs[1:] details = self.getThirdpartyLibs(...
[ "def", "getThirdPartyLibFiles", "(", "self", ",", "libs", ")", ":", "platformDefaults", "=", "True", "if", "libs", "[", "0", "]", "==", "'--nodefaults'", ":", "platformDefaults", "=", "False", "libs", "=", "libs", "[", "1", ":", "]", "details", "=", "sel...
Retrieves the list of library files for building against the Unreal-bundled versions of the specified third-party libraries
[ "Retrieves", "the", "list", "of", "library", "files", "for", "building", "against", "the", "Unreal", "-", "bundled", "versions", "of", "the", "specified", "third", "-", "party", "libraries" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L258-L268
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.getThirdPartyLibDefinitions
def getThirdPartyLibDefinitions(self, libs): """ Retrieves the list of preprocessor definitions for building against the Unreal-bundled versions of the specified third-party libraries """ platformDefaults = True if libs[0] == '--nodefaults': platformDefaults = False libs = libs[1:] details = self.g...
python
def getThirdPartyLibDefinitions(self, libs): """ Retrieves the list of preprocessor definitions for building against the Unreal-bundled versions of the specified third-party libraries """ platformDefaults = True if libs[0] == '--nodefaults': platformDefaults = False libs = libs[1:] details = self.g...
[ "def", "getThirdPartyLibDefinitions", "(", "self", ",", "libs", ")", ":", "platformDefaults", "=", "True", "if", "libs", "[", "0", "]", "==", "'--nodefaults'", ":", "platformDefaults", "=", "False", "libs", "=", "libs", "[", "1", ":", "]", "details", "=", ...
Retrieves the list of preprocessor definitions for building against the Unreal-bundled versions of the specified third-party libraries
[ "Retrieves", "the", "list", "of", "preprocessor", "definitions", "for", "building", "against", "the", "Unreal", "-", "bundled", "versions", "of", "the", "specified", "third", "-", "party", "libraries" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L270-L280
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.generateProjectFiles
def generateProjectFiles(self, dir=os.getcwd(), args=[]): """ Generates IDE project files for the Unreal project in the specified directory """ # If the project is a pure Blueprint project, then we cannot generate project files if os.path.exists(os.path.join(dir, 'Source')) == False: Utility.printStderr...
python
def generateProjectFiles(self, dir=os.getcwd(), args=[]): """ Generates IDE project files for the Unreal project in the specified directory """ # If the project is a pure Blueprint project, then we cannot generate project files if os.path.exists(os.path.join(dir, 'Source')) == False: Utility.printStderr...
[ "def", "generateProjectFiles", "(", "self", ",", "dir", "=", "os", ".", "getcwd", "(", ")", ",", "args", "=", "[", "]", ")", ":", "# If the project is a pure Blueprint project, then we cannot generate project files", "if", "os", ".", "path", ".", "exists", "(", ...
Generates IDE project files for the Unreal project in the specified directory
[ "Generates", "IDE", "project", "files", "for", "the", "Unreal", "project", "in", "the", "specified", "directory" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L282-L295
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.cleanDescriptor
def cleanDescriptor(self, dir=os.getcwd()): """ Cleans the build artifacts for the Unreal project or plugin in the specified directory """ # Verify that an Unreal project or plugin exists in the specified directory descriptor = self.getDescriptor(dir) # Because performing a clean will also delete the ...
python
def cleanDescriptor(self, dir=os.getcwd()): """ Cleans the build artifacts for the Unreal project or plugin in the specified directory """ # Verify that an Unreal project or plugin exists in the specified directory descriptor = self.getDescriptor(dir) # Because performing a clean will also delete the ...
[ "def", "cleanDescriptor", "(", "self", ",", "dir", "=", "os", ".", "getcwd", "(", ")", ")", ":", "# Verify that an Unreal project or plugin exists in the specified directory", "descriptor", "=", "self", ".", "getDescriptor", "(", "dir", ")", "# Because performing a clea...
Cleans the build artifacts for the Unreal project or plugin in the specified directory
[ "Cleans", "the", "build", "artifacts", "for", "the", "Unreal", "project", "or", "plugin", "in", "the", "specified", "directory" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L297-L314
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.buildDescriptor
def buildDescriptor(self, dir=os.getcwd(), configuration='Development', args=[], suppressOutput=False): """ Builds the editor modules for the Unreal project or plugin in the specified directory, using the specified build configuration """ # Verify that an Unreal project or plugin exists in the specified dire...
python
def buildDescriptor(self, dir=os.getcwd(), configuration='Development', args=[], suppressOutput=False): """ Builds the editor modules for the Unreal project or plugin in the specified directory, using the specified build configuration """ # Verify that an Unreal project or plugin exists in the specified dire...
[ "def", "buildDescriptor", "(", "self", ",", "dir", "=", "os", ".", "getcwd", "(", ")", ",", "configuration", "=", "'Development'", ",", "args", "=", "[", "]", ",", "suppressOutput", "=", "False", ")", ":", "# Verify that an Unreal project or plugin exists in the...
Builds the editor modules for the Unreal project or plugin in the specified directory, using the specified build configuration
[ "Builds", "the", "editor", "modules", "for", "the", "Unreal", "project", "or", "plugin", "in", "the", "specified", "directory", "using", "the", "specified", "build", "configuration" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L316-L339
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.runEditor
def runEditor(self, dir=os.getcwd(), debug=False, args=[]): """ Runs the editor for the Unreal project in the specified directory (or without a project if dir is None) """ projectFile = self.getProjectDescriptor(dir) if dir is not None else '' extraFlags = ['-debug'] + args if debug == True else args Utilit...
python
def runEditor(self, dir=os.getcwd(), debug=False, args=[]): """ Runs the editor for the Unreal project in the specified directory (or without a project if dir is None) """ projectFile = self.getProjectDescriptor(dir) if dir is not None else '' extraFlags = ['-debug'] + args if debug == True else args Utilit...
[ "def", "runEditor", "(", "self", ",", "dir", "=", "os", ".", "getcwd", "(", ")", ",", "debug", "=", "False", ",", "args", "=", "[", "]", ")", ":", "projectFile", "=", "self", ".", "getProjectDescriptor", "(", "dir", ")", "if", "dir", "is", "not", ...
Runs the editor for the Unreal project in the specified directory (or without a project if dir is None)
[ "Runs", "the", "editor", "for", "the", "Unreal", "project", "in", "the", "specified", "directory", "(", "or", "without", "a", "project", "if", "dir", "is", "None", ")" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L341-L347
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.runUAT
def runUAT(self, args): """ Runs the Unreal Automation Tool with the supplied arguments """ Utility.run([self.getRunUATScript()] + args, cwd=self.getEngineRoot(), raiseOnError=True)
python
def runUAT(self, args): """ Runs the Unreal Automation Tool with the supplied arguments """ Utility.run([self.getRunUATScript()] + args, cwd=self.getEngineRoot(), raiseOnError=True)
[ "def", "runUAT", "(", "self", ",", "args", ")", ":", "Utility", ".", "run", "(", "[", "self", ".", "getRunUATScript", "(", ")", "]", "+", "args", ",", "cwd", "=", "self", ".", "getEngineRoot", "(", ")", ",", "raiseOnError", "=", "True", ")" ]
Runs the Unreal Automation Tool with the supplied arguments
[ "Runs", "the", "Unreal", "Automation", "Tool", "with", "the", "supplied", "arguments" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L349-L353
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.packageProject
def packageProject(self, dir=os.getcwd(), configuration='Shipping', extraArgs=[]): """ Packages a build of the Unreal project in the specified directory, using common packaging options """ # Verify that the specified build configuration is valid if configuration not in self.validBuildConfigurations(): r...
python
def packageProject(self, dir=os.getcwd(), configuration='Shipping', extraArgs=[]): """ Packages a build of the Unreal project in the specified directory, using common packaging options """ # Verify that the specified build configuration is valid if configuration not in self.validBuildConfigurations(): r...
[ "def", "packageProject", "(", "self", ",", "dir", "=", "os", ".", "getcwd", "(", ")", ",", "configuration", "=", "'Shipping'", ",", "extraArgs", "=", "[", "]", ")", ":", "# Verify that the specified build configuration is valid", "if", "configuration", "not", "i...
Packages a build of the Unreal project in the specified directory, using common packaging options
[ "Packages", "a", "build", "of", "the", "Unreal", "project", "in", "the", "specified", "directory", "using", "common", "packaging", "options" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L355-L398
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.packagePlugin
def packagePlugin(self, dir=os.getcwd(), extraArgs=[]): """ Packages a build of the Unreal plugin in the specified directory, suitable for use as a prebuilt Engine module """ # Invoke UAT to package the build distDir = os.path.join(os.path.abspath(dir), 'dist') self.runUAT([ 'BuildPlugin', '-Plugin...
python
def packagePlugin(self, dir=os.getcwd(), extraArgs=[]): """ Packages a build of the Unreal plugin in the specified directory, suitable for use as a prebuilt Engine module """ # Invoke UAT to package the build distDir = os.path.join(os.path.abspath(dir), 'dist') self.runUAT([ 'BuildPlugin', '-Plugin...
[ "def", "packagePlugin", "(", "self", ",", "dir", "=", "os", ".", "getcwd", "(", ")", ",", "extraArgs", "=", "[", "]", ")", ":", "# Invoke UAT to package the build", "distDir", "=", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "abspath",...
Packages a build of the Unreal plugin in the specified directory, suitable for use as a prebuilt Engine module
[ "Packages", "a", "build", "of", "the", "Unreal", "plugin", "in", "the", "specified", "directory", "suitable", "for", "use", "as", "a", "prebuilt", "Engine", "module" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L400-L411
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.packageDescriptor
def packageDescriptor(self, dir=os.getcwd(), args=[]): """ Packages a build of the Unreal project or plugin in the specified directory """ # Verify that an Unreal project or plugin exists in the specified directory descriptor = self.getDescriptor(dir) # Perform the packaging step if self.isProject(d...
python
def packageDescriptor(self, dir=os.getcwd(), args=[]): """ Packages a build of the Unreal project or plugin in the specified directory """ # Verify that an Unreal project or plugin exists in the specified directory descriptor = self.getDescriptor(dir) # Perform the packaging step if self.isProject(d...
[ "def", "packageDescriptor", "(", "self", ",", "dir", "=", "os", ".", "getcwd", "(", ")", ",", "args", "=", "[", "]", ")", ":", "# Verify that an Unreal project or plugin exists in the specified directory", "descriptor", "=", "self", ".", "getDescriptor", "(", "dir...
Packages a build of the Unreal project or plugin in the specified directory
[ "Packages", "a", "build", "of", "the", "Unreal", "project", "or", "plugin", "in", "the", "specified", "directory" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L413-L425
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase.runAutomationCommands
def runAutomationCommands(self, projectFile, commands, capture=False): ''' Invokes the Automation Test commandlet for the specified project with the supplied automation test commands ''' # IMPORTANT IMPLEMENTATION NOTE: # We need to format the command as a string and execute it using a shell in order to ...
python
def runAutomationCommands(self, projectFile, commands, capture=False): ''' Invokes the Automation Test commandlet for the specified project with the supplied automation test commands ''' # IMPORTANT IMPLEMENTATION NOTE: # We need to format the command as a string and execute it using a shell in order to ...
[ "def", "runAutomationCommands", "(", "self", ",", "projectFile", ",", "commands", ",", "capture", "=", "False", ")", ":", "# IMPORTANT IMPLEMENTATION NOTE:", "# We need to format the command as a string and execute it using a shell in order to", "# ensure the \"-ExecCmds\" argument w...
Invokes the Automation Test commandlet for the specified project with the supplied automation test commands
[ "Invokes", "the", "Automation", "Test", "commandlet", "for", "the", "specified", "project", "with", "the", "supplied", "automation", "test", "commands" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L427-L449
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase._getEngineRoot
def _getEngineRoot(self): """ Retrieves the user-specified engine root directory override (if set), or else performs auto-detection """ override = ConfigurationManager.getConfigKey('rootDirOverride') if override != None: Utility.printStderr('Using user-specified engine root: ' + override) return overrid...
python
def _getEngineRoot(self): """ Retrieves the user-specified engine root directory override (if set), or else performs auto-detection """ override = ConfigurationManager.getConfigKey('rootDirOverride') if override != None: Utility.printStderr('Using user-specified engine root: ' + override) return overrid...
[ "def", "_getEngineRoot", "(", "self", ")", ":", "override", "=", "ConfigurationManager", ".", "getConfigKey", "(", "'rootDirOverride'", ")", "if", "override", "!=", "None", ":", "Utility", ".", "printStderr", "(", "'Using user-specified engine root: '", "+", "overri...
Retrieves the user-specified engine root directory override (if set), or else performs auto-detection
[ "Retrieves", "the", "user", "-", "specified", "engine", "root", "directory", "override", "(", "if", "set", ")", "or", "else", "performs", "auto", "-", "detection" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L538-L547
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase._getEngineVersionDetails
def _getEngineVersionDetails(self): """ Parses the JSON version details for the latest installed version of UE4 """ versionFile = os.path.join(self.getEngineRoot(), 'Engine', 'Build', 'Build.version') return json.loads(Utility.readFile(versionFile))
python
def _getEngineVersionDetails(self): """ Parses the JSON version details for the latest installed version of UE4 """ versionFile = os.path.join(self.getEngineRoot(), 'Engine', 'Build', 'Build.version') return json.loads(Utility.readFile(versionFile))
[ "def", "_getEngineVersionDetails", "(", "self", ")", ":", "versionFile", "=", "os", ".", "path", ".", "join", "(", "self", ".", "getEngineRoot", "(", ")", ",", "'Engine'", ",", "'Build'", ",", "'Build.version'", ")", "return", "json", ".", "loads", "(", ...
Parses the JSON version details for the latest installed version of UE4
[ "Parses", "the", "JSON", "version", "details", "for", "the", "latest", "installed", "version", "of", "UE4" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L555-L560
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase._getEngineVersionHash
def _getEngineVersionHash(self): """ Computes the SHA-256 hash of the JSON version details for the latest installed version of UE4 """ versionDetails = self._getEngineVersionDetails() hash = hashlib.sha256() hash.update(json.dumps(versionDetails, sort_keys=True, indent=0).encode('utf-8')) return hash.hexd...
python
def _getEngineVersionHash(self): """ Computes the SHA-256 hash of the JSON version details for the latest installed version of UE4 """ versionDetails = self._getEngineVersionDetails() hash = hashlib.sha256() hash.update(json.dumps(versionDetails, sort_keys=True, indent=0).encode('utf-8')) return hash.hexd...
[ "def", "_getEngineVersionHash", "(", "self", ")", ":", "versionDetails", "=", "self", ".", "_getEngineVersionDetails", "(", ")", "hash", "=", "hashlib", ".", "sha256", "(", ")", "hash", ".", "update", "(", "json", ".", "dumps", "(", "versionDetails", ",", ...
Computes the SHA-256 hash of the JSON version details for the latest installed version of UE4
[ "Computes", "the", "SHA", "-", "256", "hash", "of", "the", "JSON", "version", "details", "for", "the", "latest", "installed", "version", "of", "UE4" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L562-L569
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase._runUnrealBuildTool
def _runUnrealBuildTool(self, target, platform, configuration, args, capture=False): """ Invokes UnrealBuildTool with the specified parameters """ platform = self._transformBuildToolPlatform(platform) arguments = [self.getBuildScript(), target, platform, configuration] + args if capture == True: return U...
python
def _runUnrealBuildTool(self, target, platform, configuration, args, capture=False): """ Invokes UnrealBuildTool with the specified parameters """ platform = self._transformBuildToolPlatform(platform) arguments = [self.getBuildScript(), target, platform, configuration] + args if capture == True: return U...
[ "def", "_runUnrealBuildTool", "(", "self", ",", "target", ",", "platform", ",", "configuration", ",", "args", ",", "capture", "=", "False", ")", ":", "platform", "=", "self", ".", "_transformBuildToolPlatform", "(", "platform", ")", "arguments", "=", "[", "s...
Invokes UnrealBuildTool with the specified parameters
[ "Invokes", "UnrealBuildTool", "with", "the", "specified", "parameters" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L607-L616
adamrehn/ue4cli
ue4cli/UnrealManagerBase.py
UnrealManagerBase._getUE4BuildInterrogator
def _getUE4BuildInterrogator(self): """ Uses UE4BuildInterrogator to interrogate UnrealBuildTool about third-party library details """ ubtLambda = lambda target, platform, config, args: self._runUnrealBuildTool(target, platform, config, args, True) interrogator = UE4BuildInterrogator(self.getEngineRoot(), sel...
python
def _getUE4BuildInterrogator(self): """ Uses UE4BuildInterrogator to interrogate UnrealBuildTool about third-party library details """ ubtLambda = lambda target, platform, config, args: self._runUnrealBuildTool(target, platform, config, args, True) interrogator = UE4BuildInterrogator(self.getEngineRoot(), sel...
[ "def", "_getUE4BuildInterrogator", "(", "self", ")", ":", "ubtLambda", "=", "lambda", "target", ",", "platform", ",", "config", ",", "args", ":", "self", ".", "_runUnrealBuildTool", "(", "target", ",", "platform", ",", "config", ",", "args", ",", "True", "...
Uses UE4BuildInterrogator to interrogate UnrealBuildTool about third-party library details
[ "Uses", "UE4BuildInterrogator", "to", "interrogate", "UnrealBuildTool", "about", "third", "-", "party", "library", "details" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UnrealManagerBase.py#L618-L624
adamrehn/ue4cli
ue4cli/JsonDataManager.py
JsonDataManager.getKey
def getKey(self, key): """ Retrieves the value for the specified dictionary key """ data = self.getDictionary() if key in data: return data[key] else: return None
python
def getKey(self, key): """ Retrieves the value for the specified dictionary key """ data = self.getDictionary() if key in data: return data[key] else: return None
[ "def", "getKey", "(", "self", ",", "key", ")", ":", "data", "=", "self", ".", "getDictionary", "(", ")", "if", "key", "in", "data", ":", "return", "data", "[", "key", "]", "else", ":", "return", "None" ]
Retrieves the value for the specified dictionary key
[ "Retrieves", "the", "value", "for", "the", "specified", "dictionary", "key" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/JsonDataManager.py#L15-L23
adamrehn/ue4cli
ue4cli/JsonDataManager.py
JsonDataManager.getDictionary
def getDictionary(self): """ Retrieves the entire data dictionary """ if os.path.exists(self.jsonFile): return json.loads(Utility.readFile(self.jsonFile)) else: return {}
python
def getDictionary(self): """ Retrieves the entire data dictionary """ if os.path.exists(self.jsonFile): return json.loads(Utility.readFile(self.jsonFile)) else: return {}
[ "def", "getDictionary", "(", "self", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "self", ".", "jsonFile", ")", ":", "return", "json", ".", "loads", "(", "Utility", ".", "readFile", "(", "self", ".", "jsonFile", ")", ")", "else", ":", "re...
Retrieves the entire data dictionary
[ "Retrieves", "the", "entire", "data", "dictionary" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/JsonDataManager.py#L25-L32
adamrehn/ue4cli
ue4cli/JsonDataManager.py
JsonDataManager.setKey
def setKey(self, key, value): """ Sets the value for the specified dictionary key """ data = self.getDictionary() data[key] = value self.setDictionary(data)
python
def setKey(self, key, value): """ Sets the value for the specified dictionary key """ data = self.getDictionary() data[key] = value self.setDictionary(data)
[ "def", "setKey", "(", "self", ",", "key", ",", "value", ")", ":", "data", "=", "self", ".", "getDictionary", "(", ")", "data", "[", "key", "]", "=", "value", "self", ".", "setDictionary", "(", "data", ")" ]
Sets the value for the specified dictionary key
[ "Sets", "the", "value", "for", "the", "specified", "dictionary", "key" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/JsonDataManager.py#L34-L40
adamrehn/ue4cli
ue4cli/JsonDataManager.py
JsonDataManager.setDictionary
def setDictionary(self, data): """ Overwrites the entire dictionary """ # Create the directory containing the JSON file if it doesn't already exist jsonDir = os.path.dirname(self.jsonFile) if os.path.exists(jsonDir) == False: os.makedirs(jsonDir) # Store the dictionary Utility.writeFile(self.js...
python
def setDictionary(self, data): """ Overwrites the entire dictionary """ # Create the directory containing the JSON file if it doesn't already exist jsonDir = os.path.dirname(self.jsonFile) if os.path.exists(jsonDir) == False: os.makedirs(jsonDir) # Store the dictionary Utility.writeFile(self.js...
[ "def", "setDictionary", "(", "self", ",", "data", ")", ":", "# Create the directory containing the JSON file if it doesn't already exist", "jsonDir", "=", "os", ".", "path", ".", "dirname", "(", "self", ".", "jsonFile", ")", "if", "os", ".", "path", ".", "exists",...
Overwrites the entire dictionary
[ "Overwrites", "the", "entire", "dictionary" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/JsonDataManager.py#L42-L53
adamrehn/ue4cli
ue4cli/UE4BuildInterrogator.py
UE4BuildInterrogator.list
def list(self, platformIdentifier, configuration, libOverrides = {}): """ Returns the list of supported UE4-bundled third-party libraries """ modules = self._getThirdPartyLibs(platformIdentifier, configuration) return sorted([m['Name'] for m in modules] + [key for key in libOverrides])
python
def list(self, platformIdentifier, configuration, libOverrides = {}): """ Returns the list of supported UE4-bundled third-party libraries """ modules = self._getThirdPartyLibs(platformIdentifier, configuration) return sorted([m['Name'] for m in modules] + [key for key in libOverrides])
[ "def", "list", "(", "self", ",", "platformIdentifier", ",", "configuration", ",", "libOverrides", "=", "{", "}", ")", ":", "modules", "=", "self", ".", "_getThirdPartyLibs", "(", "platformIdentifier", ",", "configuration", ")", "return", "sorted", "(", "[", ...
Returns the list of supported UE4-bundled third-party libraries
[ "Returns", "the", "list", "of", "supported", "UE4", "-", "bundled", "third", "-", "party", "libraries" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UE4BuildInterrogator.py#L16-L21
adamrehn/ue4cli
ue4cli/UE4BuildInterrogator.py
UE4BuildInterrogator.interrogate
def interrogate(self, platformIdentifier, configuration, libraries, libOverrides = {}): """ Interrogates UnrealBuildTool about the build flags for the specified third-party libraries """ # Determine which libraries need their modules parsed by UBT, and which are override-only libModules = list([lib for lib...
python
def interrogate(self, platformIdentifier, configuration, libraries, libOverrides = {}): """ Interrogates UnrealBuildTool about the build flags for the specified third-party libraries """ # Determine which libraries need their modules parsed by UBT, and which are override-only libModules = list([lib for lib...
[ "def", "interrogate", "(", "self", ",", "platformIdentifier", ",", "configuration", ",", "libraries", ",", "libOverrides", "=", "{", "}", ")", ":", "# Determine which libraries need their modules parsed by UBT, and which are override-only", "libModules", "=", "list", "(", ...
Interrogates UnrealBuildTool about the build flags for the specified third-party libraries
[ "Interrogates", "UnrealBuildTool", "about", "the", "build", "flags", "for", "the", "specified", "third", "-", "party", "libraries" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UE4BuildInterrogator.py#L23-L90
adamrehn/ue4cli
ue4cli/UE4BuildInterrogator.py
UE4BuildInterrogator._absolutePaths
def _absolutePaths(self, paths): """ Converts the supplied list of paths to absolute pathnames (except for pure filenames without leading relative directories) """ slashes = [p.replace('\\', '/') for p in paths] stripped = [p.replace('../', '') if p.startswith('../') else p for p in slashes] return list([p ...
python
def _absolutePaths(self, paths): """ Converts the supplied list of paths to absolute pathnames (except for pure filenames without leading relative directories) """ slashes = [p.replace('\\', '/') for p in paths] stripped = [p.replace('../', '') if p.startswith('../') else p for p in slashes] return list([p ...
[ "def", "_absolutePaths", "(", "self", ",", "paths", ")", ":", "slashes", "=", "[", "p", ".", "replace", "(", "'\\\\'", ",", "'/'", ")", "for", "p", "in", "paths", "]", "stripped", "=", "[", "p", ".", "replace", "(", "'../'", ",", "''", ")", "if",...
Converts the supplied list of paths to absolute pathnames (except for pure filenames without leading relative directories)
[ "Converts", "the", "supplied", "list", "of", "paths", "to", "absolute", "pathnames", "(", "except", "for", "pure", "filenames", "without", "leading", "relative", "directories", ")" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UE4BuildInterrogator.py#L95-L101
adamrehn/ue4cli
ue4cli/UE4BuildInterrogator.py
UE4BuildInterrogator._flatten
def _flatten(self, field, items, transform = None): """ Extracts the entry `field` from each item in the supplied iterable, flattening any nested lists """ # Retrieve the value for each item in the iterable values = [item[field] for item in items] # Flatten any nested lists flattened = [] for valu...
python
def _flatten(self, field, items, transform = None): """ Extracts the entry `field` from each item in the supplied iterable, flattening any nested lists """ # Retrieve the value for each item in the iterable values = [item[field] for item in items] # Flatten any nested lists flattened = [] for valu...
[ "def", "_flatten", "(", "self", ",", "field", ",", "items", ",", "transform", "=", "None", ")", ":", "# Retrieve the value for each item in the iterable", "values", "=", "[", "item", "[", "field", "]", "for", "item", "in", "items", "]", "# Flatten any nested lis...
Extracts the entry `field` from each item in the supplied iterable, flattening any nested lists
[ "Extracts", "the", "entry", "field", "from", "each", "item", "in", "the", "supplied", "iterable", "flattening", "any", "nested", "lists" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UE4BuildInterrogator.py#L103-L117
adamrehn/ue4cli
ue4cli/UE4BuildInterrogator.py
UE4BuildInterrogator._getThirdPartyLibs
def _getThirdPartyLibs(self, platformIdentifier, configuration): """ Runs UnrealBuildTool in JSON export mode and extracts the list of third-party libraries """ # If we have previously cached the library list for the current engine version, use the cached data cachedList = CachedDataManager.getCachedDataKe...
python
def _getThirdPartyLibs(self, platformIdentifier, configuration): """ Runs UnrealBuildTool in JSON export mode and extracts the list of third-party libraries """ # If we have previously cached the library list for the current engine version, use the cached data cachedList = CachedDataManager.getCachedDataKe...
[ "def", "_getThirdPartyLibs", "(", "self", ",", "platformIdentifier", ",", "configuration", ")", ":", "# If we have previously cached the library list for the current engine version, use the cached data", "cachedList", "=", "CachedDataManager", ".", "getCachedDataKey", "(", "self", ...
Runs UnrealBuildTool in JSON export mode and extracts the list of third-party libraries
[ "Runs", "UnrealBuildTool", "in", "JSON", "export", "mode", "and", "extracts", "the", "list", "of", "third", "-", "party", "libraries" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/UE4BuildInterrogator.py#L119-L175
adamrehn/ue4cli
ue4cli/CMakeCustomFlags.py
CMakeCustomFlags.processLibraryDetails
def processLibraryDetails(details): """ Processes the supplied ThirdPartyLibraryDetails instance and sets any custom CMake flags """ # If the header include directories list contains any directories we have flags for, add them for includeDir in details.includeDirs: # If the directory path matches an...
python
def processLibraryDetails(details): """ Processes the supplied ThirdPartyLibraryDetails instance and sets any custom CMake flags """ # If the header include directories list contains any directories we have flags for, add them for includeDir in details.includeDirs: # If the directory path matches an...
[ "def", "processLibraryDetails", "(", "details", ")", ":", "# If the header include directories list contains any directories we have flags for, add them", "for", "includeDir", "in", "details", ".", "includeDirs", ":", "# If the directory path matches any of the substrings in our list, ge...
Processes the supplied ThirdPartyLibraryDetails instance and sets any custom CMake flags
[ "Processes", "the", "supplied", "ThirdPartyLibraryDetails", "instance", "and", "sets", "any", "custom", "CMake", "flags" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/CMakeCustomFlags.py#L19-L46
adamrehn/ue4cli
ue4cli/PluginManager.py
PluginManager.getPlugins
def getPlugins(): """ Returns the list of valid ue4cli plugins """ # Retrieve the list of detected entry points in the ue4cli.plugins group plugins = { entry_point.name: entry_point.load() for entry_point in pkg_resources.iter_entry_points('ue4cli.plugins') } # Filter out any invalid plugin...
python
def getPlugins(): """ Returns the list of valid ue4cli plugins """ # Retrieve the list of detected entry points in the ue4cli.plugins group plugins = { entry_point.name: entry_point.load() for entry_point in pkg_resources.iter_entry_points('ue4cli.plugins') } # Filter out any invalid plugin...
[ "def", "getPlugins", "(", ")", ":", "# Retrieve the list of detected entry points in the ue4cli.plugins group", "plugins", "=", "{", "entry_point", ".", "name", ":", "entry_point", ".", "load", "(", ")", "for", "entry_point", "in", "pkg_resources", ".", "iter_entry_poin...
Returns the list of valid ue4cli plugins
[ "Returns", "the", "list", "of", "valid", "ue4cli", "plugins" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/PluginManager.py#L10-L34
adamrehn/ue4cli
ue4cli/ThirdPartyLibraryDetails.py
ThirdPartyLibraryDetails.getCompilerFlags
def getCompilerFlags(self, engineRoot, fmt): """ Constructs the compiler flags string for building against this library """ return Utility.join( fmt.delim, self.prefixedStrings(self.definitionPrefix, self.definitions, engineRoot) + self.prefixedStrings(self.includeDirPrefix, self.includeDirs, engine...
python
def getCompilerFlags(self, engineRoot, fmt): """ Constructs the compiler flags string for building against this library """ return Utility.join( fmt.delim, self.prefixedStrings(self.definitionPrefix, self.definitions, engineRoot) + self.prefixedStrings(self.includeDirPrefix, self.includeDirs, engine...
[ "def", "getCompilerFlags", "(", "self", ",", "engineRoot", ",", "fmt", ")", ":", "return", "Utility", ".", "join", "(", "fmt", ".", "delim", ",", "self", ".", "prefixedStrings", "(", "self", ".", "definitionPrefix", ",", "self", ".", "definitions", ",", ...
Constructs the compiler flags string for building against this library
[ "Constructs", "the", "compiler", "flags", "string", "for", "building", "against", "this", "library" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/ThirdPartyLibraryDetails.py#L71-L81
adamrehn/ue4cli
ue4cli/ThirdPartyLibraryDetails.py
ThirdPartyLibraryDetails.getLinkerFlags
def getLinkerFlags(self, engineRoot, fmt, includeLibs=True): """ Constructs the linker flags string for building against this library """ components = self.resolveRoot(self.ldFlags, engineRoot) if includeLibs == True: components.extend(self.prefixedStrings(self.linkerDirPrefix, self.linkDirs, engineRoot)) ...
python
def getLinkerFlags(self, engineRoot, fmt, includeLibs=True): """ Constructs the linker flags string for building against this library """ components = self.resolveRoot(self.ldFlags, engineRoot) if includeLibs == True: components.extend(self.prefixedStrings(self.linkerDirPrefix, self.linkDirs, engineRoot)) ...
[ "def", "getLinkerFlags", "(", "self", ",", "engineRoot", ",", "fmt", ",", "includeLibs", "=", "True", ")", ":", "components", "=", "self", ".", "resolveRoot", "(", "self", ".", "ldFlags", ",", "engineRoot", ")", "if", "includeLibs", "==", "True", ":", "c...
Constructs the linker flags string for building against this library
[ "Constructs", "the", "linker", "flags", "string", "for", "building", "against", "this", "library" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/ThirdPartyLibraryDetails.py#L83-L92
adamrehn/ue4cli
ue4cli/ThirdPartyLibraryDetails.py
ThirdPartyLibraryDetails.getPrefixDirectories
def getPrefixDirectories(self, engineRoot, delimiter=' '): """ Returns the list of prefix directories for this library, joined using the specified delimiter """ return delimiter.join(self.resolveRoot(self.prefixDirs, engineRoot))
python
def getPrefixDirectories(self, engineRoot, delimiter=' '): """ Returns the list of prefix directories for this library, joined using the specified delimiter """ return delimiter.join(self.resolveRoot(self.prefixDirs, engineRoot))
[ "def", "getPrefixDirectories", "(", "self", ",", "engineRoot", ",", "delimiter", "=", "' '", ")", ":", "return", "delimiter", ".", "join", "(", "self", ".", "resolveRoot", "(", "self", ".", "prefixDirs", ",", "engineRoot", ")", ")" ]
Returns the list of prefix directories for this library, joined using the specified delimiter
[ "Returns", "the", "list", "of", "prefix", "directories", "for", "this", "library", "joined", "using", "the", "specified", "delimiter" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/ThirdPartyLibraryDetails.py#L94-L98
adamrehn/ue4cli
ue4cli/ThirdPartyLibraryDetails.py
ThirdPartyLibraryDetails.getIncludeDirectories
def getIncludeDirectories(self, engineRoot, delimiter=' '): """ Returns the list of include directories for this library, joined using the specified delimiter """ return delimiter.join(self.resolveRoot(self.includeDirs, engineRoot))
python
def getIncludeDirectories(self, engineRoot, delimiter=' '): """ Returns the list of include directories for this library, joined using the specified delimiter """ return delimiter.join(self.resolveRoot(self.includeDirs, engineRoot))
[ "def", "getIncludeDirectories", "(", "self", ",", "engineRoot", ",", "delimiter", "=", "' '", ")", ":", "return", "delimiter", ".", "join", "(", "self", ".", "resolveRoot", "(", "self", ".", "includeDirs", ",", "engineRoot", ")", ")" ]
Returns the list of include directories for this library, joined using the specified delimiter
[ "Returns", "the", "list", "of", "include", "directories", "for", "this", "library", "joined", "using", "the", "specified", "delimiter" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/ThirdPartyLibraryDetails.py#L100-L104
adamrehn/ue4cli
ue4cli/ThirdPartyLibraryDetails.py
ThirdPartyLibraryDetails.getLinkerDirectories
def getLinkerDirectories(self, engineRoot, delimiter=' '): """ Returns the list of linker directories for this library, joined using the specified delimiter """ return delimiter.join(self.resolveRoot(self.linkDirs, engineRoot))
python
def getLinkerDirectories(self, engineRoot, delimiter=' '): """ Returns the list of linker directories for this library, joined using the specified delimiter """ return delimiter.join(self.resolveRoot(self.linkDirs, engineRoot))
[ "def", "getLinkerDirectories", "(", "self", ",", "engineRoot", ",", "delimiter", "=", "' '", ")", ":", "return", "delimiter", ".", "join", "(", "self", ".", "resolveRoot", "(", "self", ".", "linkDirs", ",", "engineRoot", ")", ")" ]
Returns the list of linker directories for this library, joined using the specified delimiter
[ "Returns", "the", "list", "of", "linker", "directories", "for", "this", "library", "joined", "using", "the", "specified", "delimiter" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/ThirdPartyLibraryDetails.py#L106-L110
adamrehn/ue4cli
ue4cli/ThirdPartyLibraryDetails.py
ThirdPartyLibraryDetails.getLibraryFiles
def getLibraryFiles(self, engineRoot, delimiter=' '): """ Returns the list of library files for this library, joined using the specified delimiter """ return delimiter.join(self.resolveRoot(self.libs, engineRoot))
python
def getLibraryFiles(self, engineRoot, delimiter=' '): """ Returns the list of library files for this library, joined using the specified delimiter """ return delimiter.join(self.resolveRoot(self.libs, engineRoot))
[ "def", "getLibraryFiles", "(", "self", ",", "engineRoot", ",", "delimiter", "=", "' '", ")", ":", "return", "delimiter", ".", "join", "(", "self", ".", "resolveRoot", "(", "self", ".", "libs", ",", "engineRoot", ")", ")" ]
Returns the list of library files for this library, joined using the specified delimiter
[ "Returns", "the", "list", "of", "library", "files", "for", "this", "library", "joined", "using", "the", "specified", "delimiter" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/ThirdPartyLibraryDetails.py#L112-L116
adamrehn/ue4cli
ue4cli/ThirdPartyLibraryDetails.py
ThirdPartyLibraryDetails.getPreprocessorDefinitions
def getPreprocessorDefinitions(self, engineRoot, delimiter=' '): """ Returns the list of preprocessor definitions for this library, joined using the specified delimiter """ return delimiter.join(self.resolveRoot(self.definitions, engineRoot))
python
def getPreprocessorDefinitions(self, engineRoot, delimiter=' '): """ Returns the list of preprocessor definitions for this library, joined using the specified delimiter """ return delimiter.join(self.resolveRoot(self.definitions, engineRoot))
[ "def", "getPreprocessorDefinitions", "(", "self", ",", "engineRoot", ",", "delimiter", "=", "' '", ")", ":", "return", "delimiter", ".", "join", "(", "self", ".", "resolveRoot", "(", "self", ".", "definitions", ",", "engineRoot", ")", ")" ]
Returns the list of preprocessor definitions for this library, joined using the specified delimiter
[ "Returns", "the", "list", "of", "preprocessor", "definitions", "for", "this", "library", "joined", "using", "the", "specified", "delimiter" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/ThirdPartyLibraryDetails.py#L118-L122
adamrehn/ue4cli
ue4cli/ThirdPartyLibraryDetails.py
ThirdPartyLibraryDetails.getCMakeFlags
def getCMakeFlags(self, engineRoot, fmt): """ Constructs the CMake invocation flags string for building against this library """ return Utility.join( fmt.delim, [ '-DCMAKE_PREFIX_PATH=' + self.getPrefixDirectories(engineRoot, ';'), '-DCMAKE_INCLUDE_PATH=' + self.getIncludeDirectories(engineRoot, '...
python
def getCMakeFlags(self, engineRoot, fmt): """ Constructs the CMake invocation flags string for building against this library """ return Utility.join( fmt.delim, [ '-DCMAKE_PREFIX_PATH=' + self.getPrefixDirectories(engineRoot, ';'), '-DCMAKE_INCLUDE_PATH=' + self.getIncludeDirectories(engineRoot, '...
[ "def", "getCMakeFlags", "(", "self", ",", "engineRoot", ",", "fmt", ")", ":", "return", "Utility", ".", "join", "(", "fmt", ".", "delim", ",", "[", "'-DCMAKE_PREFIX_PATH='", "+", "self", ".", "getPrefixDirectories", "(", "engineRoot", ",", "';'", ")", ",",...
Constructs the CMake invocation flags string for building against this library
[ "Constructs", "the", "CMake", "invocation", "flags", "string", "for", "building", "against", "this", "library" ]
train
https://github.com/adamrehn/ue4cli/blob/f1c34502c96059e36757b7433da7e98760a75a6f/ue4cli/ThirdPartyLibraryDetails.py#L124-L136
tkrajina/git-plus
gitutils/__init__.py
is_changed
def is_changed(): """ Checks if current project has any noncommited changes. """ executed, changed_lines = execute_git('status --porcelain', output=False) merge_not_finished = mod_path.exists('.git/MERGE_HEAD') return changed_lines.strip() or merge_not_finished
python
def is_changed(): """ Checks if current project has any noncommited changes. """ executed, changed_lines = execute_git('status --porcelain', output=False) merge_not_finished = mod_path.exists('.git/MERGE_HEAD') return changed_lines.strip() or merge_not_finished
[ "def", "is_changed", "(", ")", ":", "executed", ",", "changed_lines", "=", "execute_git", "(", "'status --porcelain'", ",", "output", "=", "False", ")", "merge_not_finished", "=", "mod_path", ".", "exists", "(", "'.git/MERGE_HEAD'", ")", "return", "changed_lines",...
Checks if current project has any noncommited changes.
[ "Checks", "if", "current", "project", "has", "any", "noncommited", "changes", "." ]
train
https://github.com/tkrajina/git-plus/blob/6adf9ae5c695feab5e8ed18f93777ac05dd4957c/gitutils/__init__.py#L108-L112
edx/edx-rest-api-client
edx_rest_api_client/client.py
user_agent
def user_agent(): """ Return a User-Agent that identifies this client. Example: python-requests/2.9.1 edx-rest-api-client/1.7.2 ecommerce The last item in the list will be the application name, taken from the OS environment variable EDX_REST_API_CLIENT_NAME. If that environment variabl...
python
def user_agent(): """ Return a User-Agent that identifies this client. Example: python-requests/2.9.1 edx-rest-api-client/1.7.2 ecommerce The last item in the list will be the application name, taken from the OS environment variable EDX_REST_API_CLIENT_NAME. If that environment variabl...
[ "def", "user_agent", "(", ")", ":", "client_name", "=", "'unknown_client_name'", "try", ":", "client_name", "=", "os", ".", "environ", ".", "get", "(", "\"EDX_REST_API_CLIENT_NAME\"", ")", "or", "socket", ".", "gethostbyname", "(", "socket", ".", "gethostname", ...
Return a User-Agent that identifies this client. Example: python-requests/2.9.1 edx-rest-api-client/1.7.2 ecommerce The last item in the list will be the application name, taken from the OS environment variable EDX_REST_API_CLIENT_NAME. If that environment variable is not set, it will default ...
[ "Return", "a", "User", "-", "Agent", "that", "identifies", "this", "client", "." ]
train
https://github.com/edx/edx-rest-api-client/blob/7ed2a833691d2fdf3a4fbc9189ee5c4443bd892b/edx_rest_api_client/client.py#L14-L34
edx/edx-rest-api-client
edx_rest_api_client/client.py
get_oauth_access_token
def get_oauth_access_token(url, client_id, client_secret, token_type='jwt', grant_type='client_credentials', refresh_token=None): """ Retrieves OAuth 2.0 access token using the given grant type. Args: url (str): Oauth2 access token endpoint client_id (str): client ID ...
python
def get_oauth_access_token(url, client_id, client_secret, token_type='jwt', grant_type='client_credentials', refresh_token=None): """ Retrieves OAuth 2.0 access token using the given grant type. Args: url (str): Oauth2 access token endpoint client_id (str): client ID ...
[ "def", "get_oauth_access_token", "(", "url", ",", "client_id", ",", "client_secret", ",", "token_type", "=", "'jwt'", ",", "grant_type", "=", "'client_credentials'", ",", "refresh_token", "=", "None", ")", ":", "now", "=", "datetime", ".", "datetime", ".", "ut...
Retrieves OAuth 2.0 access token using the given grant type. Args: url (str): Oauth2 access token endpoint client_id (str): client ID client_secret (str): client secret Kwargs: token_type (str): Type of token to return. Options include bearer and jwt. grant_type (str): O...
[ "Retrieves", "OAuth", "2", ".", "0", "access", "token", "using", "the", "given", "grant", "type", "." ]
train
https://github.com/edx/edx-rest-api-client/blob/7ed2a833691d2fdf3a4fbc9189ee5c4443bd892b/edx_rest_api_client/client.py#L40-L85
edx/edx-rest-api-client
edx_rest_api_client/client.py
OAuthAPIClient.request
def request(self, method, url, **kwargs): # pylint: disable=arguments-differ """ Overrides Session.request to ensure that the session is authenticated """ self._check_auth() return super(OAuthAPIClient, self).request(method, url, **kwargs)
python
def request(self, method, url, **kwargs): # pylint: disable=arguments-differ """ Overrides Session.request to ensure that the session is authenticated """ self._check_auth() return super(OAuthAPIClient, self).request(method, url, **kwargs)
[ "def", "request", "(", "self", ",", "method", ",", "url", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=arguments-differ", "self", ".", "_check_auth", "(", ")", "return", "super", "(", "OAuthAPIClient", ",", "self", ")", ".", "request", "(", "metho...
Overrides Session.request to ensure that the session is authenticated
[ "Overrides", "Session", ".", "request", "to", "ensure", "that", "the", "session", "is", "authenticated" ]
train
https://github.com/edx/edx-rest-api-client/blob/7ed2a833691d2fdf3a4fbc9189ee5c4443bd892b/edx_rest_api_client/client.py#L121-L126
greenbone/ospd
ospd/ospd_ssh.py
OSPDaemonSimpleSSH.run_command
def run_command(self, scan_id, host, cmd): """ Run a single command via SSH and return the content of stdout or None in case of an Error. A scan error is issued in the latter case. For logging into 'host', the scan options 'port', 'username', 'password' and 'ssh_timeout'...
python
def run_command(self, scan_id, host, cmd): """ Run a single command via SSH and return the content of stdout or None in case of an Error. A scan error is issued in the latter case. For logging into 'host', the scan options 'port', 'username', 'password' and 'ssh_timeout'...
[ "def", "run_command", "(", "self", ",", "scan_id", ",", "host", ",", "cmd", ")", ":", "ssh", "=", "paramiko", ".", "SSHClient", "(", ")", "ssh", ".", "set_missing_host_key_policy", "(", "paramiko", ".", "AutoAddPolicy", "(", ")", ")", "options", "=", "se...
Run a single command via SSH and return the content of stdout or None in case of an Error. A scan error is issued in the latter case. For logging into 'host', the scan options 'port', 'username', 'password' and 'ssh_timeout' are used.
[ "Run", "a", "single", "command", "via", "SSH", "and", "return", "the", "content", "of", "stdout", "or", "None", "in", "case", "of", "an", "Error", ".", "A", "scan", "error", "is", "issued", "in", "the", "latter", "case", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd_ssh.py#L94-L147
greenbone/ospd
ospd/xml.py
get_result_xml
def get_result_xml(result): """ Formats a scan result to XML format. Arguments: result (dict): Dictionary with a scan result. Return: Result as xml element object. """ result_xml = Element('result') for name, value in [('name', result['name']), ('type', ...
python
def get_result_xml(result): """ Formats a scan result to XML format. Arguments: result (dict): Dictionary with a scan result. Return: Result as xml element object. """ result_xml = Element('result') for name, value in [('name', result['name']), ('type', ...
[ "def", "get_result_xml", "(", "result", ")", ":", "result_xml", "=", "Element", "(", "'result'", ")", "for", "name", ",", "value", "in", "[", "(", "'name'", ",", "result", "[", "'name'", "]", ")", ",", "(", "'type'", ",", "ResultType", ".", "get_str", ...
Formats a scan result to XML format. Arguments: result (dict): Dictionary with a scan result. Return: Result as xml element object.
[ "Formats", "a", "scan", "result", "to", "XML", "format", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/xml.py#L25-L44
greenbone/ospd
ospd/xml.py
simple_response_str
def simple_response_str(command, status, status_text, content=""): """ Creates an OSP response XML string. Arguments: command (str): OSP Command to respond to. status (int): Status of the response. status_text (str): Status text of the response. content (str): Text part of the r...
python
def simple_response_str(command, status, status_text, content=""): """ Creates an OSP response XML string. Arguments: command (str): OSP Command to respond to. status (int): Status of the response. status_text (str): Status text of the response. content (str): Text part of the r...
[ "def", "simple_response_str", "(", "command", ",", "status", ",", "status_text", ",", "content", "=", "\"\"", ")", ":", "response", "=", "Element", "(", "'%s_response'", "%", "command", ")", "for", "name", ",", "value", "in", "[", "(", "'status'", ",", "...
Creates an OSP response XML string. Arguments: command (str): OSP Command to respond to. status (int): Status of the response. status_text (str): Status text of the response. content (str): Text part of the response XML element. Return: String of response in xml format.
[ "Creates", "an", "OSP", "response", "XML", "string", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/xml.py#L47-L69
greenbone/ospd
ospd/ospd.py
bind_socket
def bind_socket(address, port): """ Returns a socket bound on (address:port). """ assert address assert port bindsocket = socket.socket() try: bindsocket.bind((address, port)) except socket.error: logger.error("Couldn't bind socket on %s:%s", address, port) return None ...
python
def bind_socket(address, port): """ Returns a socket bound on (address:port). """ assert address assert port bindsocket = socket.socket() try: bindsocket.bind((address, port)) except socket.error: logger.error("Couldn't bind socket on %s:%s", address, port) return None ...
[ "def", "bind_socket", "(", "address", ",", "port", ")", ":", "assert", "address", "assert", "port", "bindsocket", "=", "socket", ".", "socket", "(", ")", "try", ":", "bindsocket", ".", "bind", "(", "(", "address", ",", "port", ")", ")", "except", "sock...
Returns a socket bound on (address:port).
[ "Returns", "a", "socket", "bound", "on", "(", "address", ":", "port", ")", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L132-L146
greenbone/ospd
ospd/ospd.py
bind_unix_socket
def bind_unix_socket(path): """ Returns a unix file socket bound on (path). """ assert path bindsocket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) try: os.unlink(path) except OSError: if os.path.exists(path): raise try: bindsocket.bind(path) excep...
python
def bind_unix_socket(path): """ Returns a unix file socket bound on (path). """ assert path bindsocket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) try: os.unlink(path) except OSError: if os.path.exists(path): raise try: bindsocket.bind(path) excep...
[ "def", "bind_unix_socket", "(", "path", ")", ":", "assert", "path", "bindsocket", "=", "socket", ".", "socket", "(", "socket", ".", "AF_UNIX", ",", "socket", ".", "SOCK_STREAM", ")", "try", ":", "os", ".", "unlink", "(", "path", ")", "except", "OSError",...
Returns a unix file socket bound on (path).
[ "Returns", "a", "unix", "file", "socket", "bound", "on", "(", "path", ")", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L148-L166
greenbone/ospd
ospd/ospd.py
close_client_stream
def close_client_stream(client_stream, unix_path): """ Closes provided client stream """ try: client_stream.shutdown(socket.SHUT_RDWR) if unix_path: logger.debug('%s: Connection closed', unix_path) else: peer = client_stream.getpeername() logger.debug(...
python
def close_client_stream(client_stream, unix_path): """ Closes provided client stream """ try: client_stream.shutdown(socket.SHUT_RDWR) if unix_path: logger.debug('%s: Connection closed', unix_path) else: peer = client_stream.getpeername() logger.debug(...
[ "def", "close_client_stream", "(", "client_stream", ",", "unix_path", ")", ":", "try", ":", "client_stream", ".", "shutdown", "(", "socket", ".", "SHUT_RDWR", ")", "if", "unix_path", ":", "logger", ".", "debug", "(", "'%s: Connection closed'", ",", "unix_path", ...
Closes provided client stream
[ "Closes", "provided", "client", "stream" ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L169-L180
greenbone/ospd
ospd/ospd.py
OSPDaemon.set_command_attributes
def set_command_attributes(self, name, attributes): """ Sets the xml attributes of a specified command. """ if self.command_exists(name): command = self.commands.get(name) command['attributes'] = attributes
python
def set_command_attributes(self, name, attributes): """ Sets the xml attributes of a specified command. """ if self.command_exists(name): command = self.commands.get(name) command['attributes'] = attributes
[ "def", "set_command_attributes", "(", "self", ",", "name", ",", "attributes", ")", ":", "if", "self", ".", "command_exists", "(", "name", ")", ":", "command", "=", "self", ".", "commands", ".", "get", "(", "name", ")", "command", "[", "'attributes'", "]"...
Sets the xml attributes of a specified command.
[ "Sets", "the", "xml", "attributes", "of", "a", "specified", "command", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L243-L247
greenbone/ospd
ospd/ospd.py
OSPDaemon.add_scanner_param
def add_scanner_param(self, name, scanner_param): """ Add a scanner parameter. """ assert name assert scanner_param self.scanner_params[name] = scanner_param command = self.commands.get('start_scan') command['elements'] = { 'scanner_params': {...
python
def add_scanner_param(self, name, scanner_param): """ Add a scanner parameter. """ assert name assert scanner_param self.scanner_params[name] = scanner_param command = self.commands.get('start_scan') command['elements'] = { 'scanner_params': {...
[ "def", "add_scanner_param", "(", "self", ",", "name", ",", "scanner_param", ")", ":", "assert", "name", "assert", "scanner_param", "self", ".", "scanner_params", "[", "name", "]", "=", "scanner_param", "command", "=", "self", ".", "commands", ".", "get", "("...
Add a scanner parameter.
[ "Add", "a", "scanner", "parameter", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L249-L258
greenbone/ospd
ospd/ospd.py
OSPDaemon.add_vt
def add_vt(self, vt_id, name=None, vt_params=None, vt_refs=None, custom=None, vt_creation_time=None, vt_modification_time=None, vt_dependencies=None, summary=None, impact=None, affected=None, insight=None, solution=None, solution_t=None, detection=None, qod_t=...
python
def add_vt(self, vt_id, name=None, vt_params=None, vt_refs=None, custom=None, vt_creation_time=None, vt_modification_time=None, vt_dependencies=None, summary=None, impact=None, affected=None, insight=None, solution=None, solution_t=None, detection=None, qod_t=...
[ "def", "add_vt", "(", "self", ",", "vt_id", ",", "name", "=", "None", ",", "vt_params", "=", "None", ",", "vt_refs", "=", "None", ",", "custom", "=", "None", ",", "vt_creation_time", "=", "None", ",", "vt_modification_time", "=", "None", ",", "vt_depende...
Add a vulnerability test information. Returns: The new number of stored VTs. -1 in case the VT ID was already present and thus the new VT was not considered. -2 in case the vt_id was invalid.
[ "Add", "a", "vulnerability", "test", "information", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L260-L319
greenbone/ospd
ospd/ospd.py
OSPDaemon._preprocess_scan_params
def _preprocess_scan_params(self, xml_params): """ Processes the scan parameters. """ params = {} for param in xml_params: params[param.tag] = param.text or '' # Set default values. for key in self.scanner_params: if key not in params: para...
python
def _preprocess_scan_params(self, xml_params): """ Processes the scan parameters. """ params = {} for param in xml_params: params[param.tag] = param.text or '' # Set default values. for key in self.scanner_params: if key not in params: para...
[ "def", "_preprocess_scan_params", "(", "self", ",", "xml_params", ")", ":", "params", "=", "{", "}", "for", "param", "in", "xml_params", ":", "params", "[", "param", ".", "tag", "]", "=", "param", ".", "text", "or", "''", "# Set default values.", "for", ...
Processes the scan parameters.
[ "Processes", "the", "scan", "parameters", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L363-L394
greenbone/ospd
ospd/ospd.py
OSPDaemon.process_vts_params
def process_vts_params(self, scanner_vts): """ Receive an XML object with the Vulnerability Tests an their parameters to be use in a scan and return a dictionary. @param: XML element with vt subelements. Each vt has an id attribute. Optional parameters can be included ...
python
def process_vts_params(self, scanner_vts): """ Receive an XML object with the Vulnerability Tests an their parameters to be use in a scan and return a dictionary. @param: XML element with vt subelements. Each vt has an id attribute. Optional parameters can be included ...
[ "def", "process_vts_params", "(", "self", ",", "scanner_vts", ")", ":", "vt_selection", "=", "{", "}", "filters", "=", "list", "(", ")", "for", "vt", "in", "scanner_vts", ":", "if", "vt", ".", "tag", "==", "'vt_single'", ":", "vt_id", "=", "vt", ".", ...
Receive an XML object with the Vulnerability Tests an their parameters to be use in a scan and return a dictionary. @param: XML element with vt subelements. Each vt has an id attribute. Optional parameters can be included as vt child. Example form: ...
[ "Receive", "an", "XML", "object", "with", "the", "Vulnerability", "Tests", "an", "their", "parameters", "to", "be", "use", "in", "a", "scan", "and", "return", "a", "dictionary", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L401-L445
greenbone/ospd
ospd/ospd.py
OSPDaemon.process_credentials_elements
def process_credentials_elements(cred_tree): """ Receive an XML object with the credentials to run a scan against a given target. @param: <credentials> <credential type="up" service="ssh" port="22"> <username>scanuser</username> <password>mypass</passwo...
python
def process_credentials_elements(cred_tree): """ Receive an XML object with the credentials to run a scan against a given target. @param: <credentials> <credential type="up" service="ssh" port="22"> <username>scanuser</username> <password>mypass</passwo...
[ "def", "process_credentials_elements", "(", "cred_tree", ")", ":", "credentials", "=", "{", "}", "for", "credential", "in", "cred_tree", ":", "service", "=", "credential", ".", "attrib", ".", "get", "(", "'service'", ")", "credentials", "[", "service", "]", ...
Receive an XML object with the credentials to run a scan against a given target. @param: <credentials> <credential type="up" service="ssh" port="22"> <username>scanuser</username> <password>mypass</password> </credential> <credential type="u...
[ "Receive", "an", "XML", "object", "with", "the", "credentials", "to", "run", "a", "scan", "against", "a", "given", "target", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L448-L487
greenbone/ospd
ospd/ospd.py
OSPDaemon.process_targets_element
def process_targets_element(cls, scanner_target): """ Receive an XML object with the target, ports and credentials to run a scan against. @param: XML element with target subelements. Each target has <hosts> and <ports> subelements. Hosts can be a single host, a host range, a com...
python
def process_targets_element(cls, scanner_target): """ Receive an XML object with the target, ports and credentials to run a scan against. @param: XML element with target subelements. Each target has <hosts> and <ports> subelements. Hosts can be a single host, a host range, a com...
[ "def", "process_targets_element", "(", "cls", ",", "scanner_target", ")", ":", "target_list", "=", "[", "]", "for", "target", "in", "scanner_target", ":", "ports", "=", "''", "credentials", "=", "{", "}", "for", "child", "in", "target", ":", "if", "child",...
Receive an XML object with the target, ports and credentials to run a scan against. @param: XML element with target subelements. Each target has <hosts> and <ports> subelements. Hosts can be a single host, a host range, a comma-separated host list or a network address. <ports> a...
[ "Receive", "an", "XML", "object", "with", "the", "target", "ports", "and", "credentials", "to", "run", "a", "scan", "against", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L490-L548
greenbone/ospd
ospd/ospd.py
OSPDaemon.handle_start_scan_command
def handle_start_scan_command(self, scan_et): """ Handles <start_scan> command. @return: Response string for <start_scan> command. """ target_str = scan_et.attrib.get('target') ports_str = scan_et.attrib.get('ports') # For backward compatibility, if target and ports att...
python
def handle_start_scan_command(self, scan_et): """ Handles <start_scan> command. @return: Response string for <start_scan> command. """ target_str = scan_et.attrib.get('target') ports_str = scan_et.attrib.get('ports') # For backward compatibility, if target and ports att...
[ "def", "handle_start_scan_command", "(", "self", ",", "scan_et", ")", ":", "target_str", "=", "scan_et", ".", "attrib", ".", "get", "(", "'target'", ")", "ports_str", "=", "scan_et", ".", "attrib", ".", "get", "(", "'ports'", ")", "# For backward compatibility...
Handles <start_scan> command. @return: Response string for <start_scan> command.
[ "Handles", "<start_scan", ">", "command", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L550-L616
greenbone/ospd
ospd/ospd.py
OSPDaemon.handle_stop_scan_command
def handle_stop_scan_command(self, scan_et): """ Handles <stop_scan> command. @return: Response string for <stop_scan> command. """ scan_id = scan_et.attrib.get('scan_id') if scan_id is None or scan_id == '': raise OSPDError('No scan_id attribute', 'stop_scan') ...
python
def handle_stop_scan_command(self, scan_et): """ Handles <stop_scan> command. @return: Response string for <stop_scan> command. """ scan_id = scan_et.attrib.get('scan_id') if scan_id is None or scan_id == '': raise OSPDError('No scan_id attribute', 'stop_scan') ...
[ "def", "handle_stop_scan_command", "(", "self", ",", "scan_et", ")", ":", "scan_id", "=", "scan_et", ".", "attrib", ".", "get", "(", "'scan_id'", ")", "if", "scan_id", "is", "None", "or", "scan_id", "==", "''", ":", "raise", "OSPDError", "(", "'No scan_id ...
Handles <stop_scan> command. @return: Response string for <stop_scan> command.
[ "Handles", "<stop_scan", ">", "command", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L618-L629
greenbone/ospd
ospd/ospd.py
OSPDaemon.finish_scan
def finish_scan(self, scan_id): """ Sets a scan as finished. """ self.set_scan_progress(scan_id, 100) self.set_scan_status(scan_id, ScanStatus.FINISHED) logger.info("%s: Scan finished.", scan_id)
python
def finish_scan(self, scan_id): """ Sets a scan as finished. """ self.set_scan_progress(scan_id, 100) self.set_scan_status(scan_id, ScanStatus.FINISHED) logger.info("%s: Scan finished.", scan_id)
[ "def", "finish_scan", "(", "self", ",", "scan_id", ")", ":", "self", ".", "set_scan_progress", "(", "scan_id", ",", "100", ")", "self", ".", "set_scan_status", "(", "scan_id", ",", "ScanStatus", ".", "FINISHED", ")", "logger", ".", "info", "(", "\"%s: Scan...
Sets a scan as finished.
[ "Sets", "a", "scan", "as", "finished", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L661-L665
greenbone/ospd
ospd/ospd.py
OSPDaemon.get_scanner_param_type
def get_scanner_param_type(self, param): """ Returns type of a scanner parameter. """ assert isinstance(param, str) entry = self.scanner_params.get(param) if not entry: return None return entry.get('type')
python
def get_scanner_param_type(self, param): """ Returns type of a scanner parameter. """ assert isinstance(param, str) entry = self.scanner_params.get(param) if not entry: return None return entry.get('type')
[ "def", "get_scanner_param_type", "(", "self", ",", "param", ")", ":", "assert", "isinstance", "(", "param", ",", "str", ")", "entry", "=", "self", ".", "scanner_params", ".", "get", "(", "param", ")", "if", "not", "entry", ":", "return", "None", "return"...
Returns type of a scanner parameter.
[ "Returns", "type", "of", "a", "scanner", "parameter", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L675-L681
greenbone/ospd
ospd/ospd.py
OSPDaemon.get_scanner_param_mandatory
def get_scanner_param_mandatory(self, param): """ Returns if a scanner parameter is mandatory. """ assert isinstance(param, str) entry = self.scanner_params.get(param) if not entry: return False return entry.get('mandatory')
python
def get_scanner_param_mandatory(self, param): """ Returns if a scanner parameter is mandatory. """ assert isinstance(param, str) entry = self.scanner_params.get(param) if not entry: return False return entry.get('mandatory')
[ "def", "get_scanner_param_mandatory", "(", "self", ",", "param", ")", ":", "assert", "isinstance", "(", "param", ",", "str", ")", "entry", "=", "self", ".", "scanner_params", ".", "get", "(", "param", ")", "if", "not", "entry", ":", "return", "False", "r...
Returns if a scanner parameter is mandatory.
[ "Returns", "if", "a", "scanner", "parameter", "is", "mandatory", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L683-L689
greenbone/ospd
ospd/ospd.py
OSPDaemon.get_scanner_param_default
def get_scanner_param_default(self, param): """ Returns default value of a scanner parameter. """ assert isinstance(param, str) entry = self.scanner_params.get(param) if not entry: return None return entry.get('default')
python
def get_scanner_param_default(self, param): """ Returns default value of a scanner parameter. """ assert isinstance(param, str) entry = self.scanner_params.get(param) if not entry: return None return entry.get('default')
[ "def", "get_scanner_param_default", "(", "self", ",", "param", ")", ":", "assert", "isinstance", "(", "param", ",", "str", ")", "entry", "=", "self", ".", "scanner_params", ".", "get", "(", "param", ")", "if", "not", "entry", ":", "return", "None", "retu...
Returns default value of a scanner parameter.
[ "Returns", "default", "value", "of", "a", "scanner", "parameter", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L691-L697
greenbone/ospd
ospd/ospd.py
OSPDaemon.get_scanner_params_xml
def get_scanner_params_xml(self): """ Returns the OSP Daemon's scanner params in xml format. """ scanner_params = Element('scanner_params') for param_id, param in self.scanner_params.items(): param_xml = SubElement(scanner_params, 'scanner_param') for name, value in [('id...
python
def get_scanner_params_xml(self): """ Returns the OSP Daemon's scanner params in xml format. """ scanner_params = Element('scanner_params') for param_id, param in self.scanner_params.items(): param_xml = SubElement(scanner_params, 'scanner_param') for name, value in [('id...
[ "def", "get_scanner_params_xml", "(", "self", ")", ":", "scanner_params", "=", "Element", "(", "'scanner_params'", ")", "for", "param_id", ",", "param", "in", "self", ".", "scanner_params", ".", "items", "(", ")", ":", "param_xml", "=", "SubElement", "(", "s...
Returns the OSP Daemon's scanner params in xml format.
[ "Returns", "the", "OSP", "Daemon", "s", "scanner", "params", "in", "xml", "format", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L699-L713
greenbone/ospd
ospd/ospd.py
OSPDaemon.new_client_stream
def new_client_stream(self, sock): """ Returns a new ssl client stream from bind_socket. """ assert sock newsocket, fromaddr = sock.accept() logger.debug("New connection from" " %s:%s", fromaddr[0], fromaddr[1]) # NB: Despite the name, ssl.PROTOCOL_SSLv23 se...
python
def new_client_stream(self, sock): """ Returns a new ssl client stream from bind_socket. """ assert sock newsocket, fromaddr = sock.accept() logger.debug("New connection from" " %s:%s", fromaddr[0], fromaddr[1]) # NB: Despite the name, ssl.PROTOCOL_SSLv23 se...
[ "def", "new_client_stream", "(", "self", ",", "sock", ")", ":", "assert", "sock", "newsocket", ",", "fromaddr", "=", "sock", ".", "accept", "(", ")", "logger", ".", "debug", "(", "\"New connection from\"", "\" %s:%s\"", ",", "fromaddr", "[", "0", "]", ",",...
Returns a new ssl client stream from bind_socket.
[ "Returns", "a", "new", "ssl", "client", "stream", "from", "bind_socket", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L715-L738
greenbone/ospd
ospd/ospd.py
OSPDaemon.write_to_stream
def write_to_stream(stream, response, block_len=1024): """ Send the response in blocks of the given len using the passed method dependending on the socket type. """ try: i_start = 0 i_end = block_len while True: if i_end > len(r...
python
def write_to_stream(stream, response, block_len=1024): """ Send the response in blocks of the given len using the passed method dependending on the socket type. """ try: i_start = 0 i_end = block_len while True: if i_end > len(r...
[ "def", "write_to_stream", "(", "stream", ",", "response", ",", "block_len", "=", "1024", ")", ":", "try", ":", "i_start", "=", "0", "i_end", "=", "block_len", "while", "True", ":", "if", "i_end", ">", "len", "(", "response", ")", ":", "stream", "(", ...
Send the response in blocks of the given len using the passed method dependending on the socket type.
[ "Send", "the", "response", "in", "blocks", "of", "the", "given", "len", "using", "the", "passed", "method", "dependending", "on", "the", "socket", "type", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L741-L757
greenbone/ospd
ospd/ospd.py
OSPDaemon.handle_client_stream
def handle_client_stream(self, stream, is_unix=False): """ Handles stream of data received from client. """ assert stream data = [] stream.settimeout(2) while True: try: if is_unix: buf = stream.recv(1024) else: ...
python
def handle_client_stream(self, stream, is_unix=False): """ Handles stream of data received from client. """ assert stream data = [] stream.settimeout(2) while True: try: if is_unix: buf = stream.recv(1024) else: ...
[ "def", "handle_client_stream", "(", "self", ",", "stream", ",", "is_unix", "=", "False", ")", ":", "assert", "stream", "data", "=", "[", "]", "stream", ".", "settimeout", "(", "2", ")", "while", "True", ":", "try", ":", "if", "is_unix", ":", "buf", "...
Handles stream of data received from client.
[ "Handles", "stream", "of", "data", "received", "from", "client", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L759-L800
greenbone/ospd
ospd/ospd.py
OSPDaemon.parallel_scan
def parallel_scan(self, scan_id, target): """ Starts the scan with scan_id. """ try: ret = self.exec_scan(scan_id, target) if ret == 0: self.add_scan_host_detail(scan_id, name='host_status', host=target, value='0') ...
python
def parallel_scan(self, scan_id, target): """ Starts the scan with scan_id. """ try: ret = self.exec_scan(scan_id, target) if ret == 0: self.add_scan_host_detail(scan_id, name='host_status', host=target, value='0') ...
[ "def", "parallel_scan", "(", "self", ",", "scan_id", ",", "target", ")", ":", "try", ":", "ret", "=", "self", ".", "exec_scan", "(", "scan_id", ",", "target", ")", "if", "ret", "==", "0", ":", "self", ".", "add_scan_host_detail", "(", "scan_id", ",", ...
Starts the scan with scan_id.
[ "Starts", "the", "scan", "with", "scan_id", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L802-L822
greenbone/ospd
ospd/ospd.py
OSPDaemon.check_pending_target
def check_pending_target(self, scan_id, multiscan_proc): """ Check if a scan process is still alive. In case the process finished or is stopped, removes the process from the multiscan _process list. Processes dead and with progress < 100% are considered stopped or with failures. ...
python
def check_pending_target(self, scan_id, multiscan_proc): """ Check if a scan process is still alive. In case the process finished or is stopped, removes the process from the multiscan _process list. Processes dead and with progress < 100% are considered stopped or with failures. ...
[ "def", "check_pending_target", "(", "self", ",", "scan_id", ",", "multiscan_proc", ")", ":", "for", "running_target_proc", ",", "running_target_id", "in", "multiscan_proc", ":", "if", "not", "running_target_proc", ".", "is_alive", "(", ")", ":", "target_prog", "="...
Check if a scan process is still alive. In case the process finished or is stopped, removes the process from the multiscan _process list. Processes dead and with progress < 100% are considered stopped or with failures. Then will try to stop the other runnings (target) scans owned...
[ "Check", "if", "a", "scan", "process", "is", "still", "alive", ".", "In", "case", "the", "process", "finished", "or", "is", "stopped", "removes", "the", "process", "from", "the", "multiscan", "_process", "list", ".", "Processes", "dead", "and", "with", "pr...
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L824-L846
greenbone/ospd
ospd/ospd.py
OSPDaemon.calculate_progress
def calculate_progress(self, scan_id): """ Calculate the total scan progress from the partial target progress. """ t_prog = dict() for target in self.get_scan_target(scan_id): t_prog[target] = self.get_scan_target_progress(scan_id, target) return sum(t_prog.values())...
python
def calculate_progress(self, scan_id): """ Calculate the total scan progress from the partial target progress. """ t_prog = dict() for target in self.get_scan_target(scan_id): t_prog[target] = self.get_scan_target_progress(scan_id, target) return sum(t_prog.values())...
[ "def", "calculate_progress", "(", "self", ",", "scan_id", ")", ":", "t_prog", "=", "dict", "(", ")", "for", "target", "in", "self", ".", "get_scan_target", "(", "scan_id", ")", ":", "t_prog", "[", "target", "]", "=", "self", ".", "get_scan_target_progress"...
Calculate the total scan progress from the partial target progress.
[ "Calculate", "the", "total", "scan", "progress", "from", "the", "partial", "target", "progress", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L848-L855
greenbone/ospd
ospd/ospd.py
OSPDaemon.start_scan
def start_scan(self, scan_id, targets, parallel=1): """ Handle N parallel scans if 'parallel' is greater than 1. """ os.setsid() multiscan_proc = [] logger.info("%s: Scan started.", scan_id) target_list = targets if target_list is None or not target_list: rai...
python
def start_scan(self, scan_id, targets, parallel=1): """ Handle N parallel scans if 'parallel' is greater than 1. """ os.setsid() multiscan_proc = [] logger.info("%s: Scan started.", scan_id) target_list = targets if target_list is None or not target_list: rai...
[ "def", "start_scan", "(", "self", ",", "scan_id", ",", "targets", ",", "parallel", "=", "1", ")", ":", "os", ".", "setsid", "(", ")", "multiscan_proc", "=", "[", "]", "logger", ".", "info", "(", "\"%s: Scan started.\"", ",", "scan_id", ")", "target_list"...
Handle N parallel scans if 'parallel' is greater than 1.
[ "Handle", "N", "parallel", "scans", "if", "parallel", "is", "greater", "than", "1", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L857-L896
greenbone/ospd
ospd/ospd.py
OSPDaemon.dry_run_scan
def dry_run_scan(self, scan_id, targets): """ Dry runs a scan. """ os.setsid() for _, target in enumerate(targets): host = resolve_hostname(target[0]) if host is None: logger.info("Couldn't resolve %s.", target[0]) continue por...
python
def dry_run_scan(self, scan_id, targets): """ Dry runs a scan. """ os.setsid() for _, target in enumerate(targets): host = resolve_hostname(target[0]) if host is None: logger.info("Couldn't resolve %s.", target[0]) continue por...
[ "def", "dry_run_scan", "(", "self", ",", "scan_id", ",", "targets", ")", ":", "os", ".", "setsid", "(", ")", "for", "_", ",", "target", "in", "enumerate", "(", "targets", ")", ":", "host", "=", "resolve_hostname", "(", "target", "[", "0", "]", ")", ...
Dry runs a scan.
[ "Dry", "runs", "a", "scan", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L898-L911
greenbone/ospd
ospd/ospd.py
OSPDaemon.handle_timeout
def handle_timeout(self, scan_id, host): """ Handles scanner reaching timeout error. """ self.add_scan_error(scan_id, host=host, name="Timeout", value="{0} exec timeout." .format(self.get_scanner_name()))
python
def handle_timeout(self, scan_id, host): """ Handles scanner reaching timeout error. """ self.add_scan_error(scan_id, host=host, name="Timeout", value="{0} exec timeout." .format(self.get_scanner_name()))
[ "def", "handle_timeout", "(", "self", ",", "scan_id", ",", "host", ")", ":", "self", ".", "add_scan_error", "(", "scan_id", ",", "host", "=", "host", ",", "name", "=", "\"Timeout\"", ",", "value", "=", "\"{0} exec timeout.\"", ".", "format", "(", "self", ...
Handles scanner reaching timeout error.
[ "Handles", "scanner", "reaching", "timeout", "error", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L913-L917
greenbone/ospd
ospd/ospd.py
OSPDaemon.set_scan_host_finished
def set_scan_host_finished(self, scan_id, target, host): """ Add the host in a list of finished hosts """ self.scan_collection.set_host_finished(scan_id, target, host)
python
def set_scan_host_finished(self, scan_id, target, host): """ Add the host in a list of finished hosts """ self.scan_collection.set_host_finished(scan_id, target, host)
[ "def", "set_scan_host_finished", "(", "self", ",", "scan_id", ",", "target", ",", "host", ")", ":", "self", ".", "scan_collection", ".", "set_host_finished", "(", "scan_id", ",", "target", ",", "host", ")" ]
Add the host in a list of finished hosts
[ "Add", "the", "host", "in", "a", "list", "of", "finished", "hosts" ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L919-L921
greenbone/ospd
ospd/ospd.py
OSPDaemon.set_scan_target_progress
def set_scan_target_progress( self, scan_id, target, host, progress): """ Sets host's progress which is part of target. """ self.scan_collection.set_target_progress( scan_id, target, host, progress)
python
def set_scan_target_progress( self, scan_id, target, host, progress): """ Sets host's progress which is part of target. """ self.scan_collection.set_target_progress( scan_id, target, host, progress)
[ "def", "set_scan_target_progress", "(", "self", ",", "scan_id", ",", "target", ",", "host", ",", "progress", ")", ":", "self", ".", "scan_collection", ".", "set_target_progress", "(", "scan_id", ",", "target", ",", "host", ",", "progress", ")" ]
Sets host's progress which is part of target.
[ "Sets", "host", "s", "progress", "which", "is", "part", "of", "target", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L928-L932
greenbone/ospd
ospd/ospd.py
OSPDaemon.handle_get_scans_command
def handle_get_scans_command(self, scan_et): """ Handles <get_scans> command. @return: Response string for <get_scans> command. """ scan_id = scan_et.attrib.get('scan_id') details = scan_et.attrib.get('details') pop_res = scan_et.attrib.get('pop_results') if det...
python
def handle_get_scans_command(self, scan_et): """ Handles <get_scans> command. @return: Response string for <get_scans> command. """ scan_id = scan_et.attrib.get('scan_id') details = scan_et.attrib.get('details') pop_res = scan_et.attrib.get('pop_results') if det...
[ "def", "handle_get_scans_command", "(", "self", ",", "scan_et", ")", ":", "scan_id", "=", "scan_et", ".", "attrib", ".", "get", "(", "'scan_id'", ")", "details", "=", "scan_et", ".", "attrib", ".", "get", "(", "'details'", ")", "pop_res", "=", "scan_et", ...
Handles <get_scans> command. @return: Response string for <get_scans> command.
[ "Handles", "<get_scans", ">", "command", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L949-L980
greenbone/ospd
ospd/ospd.py
OSPDaemon.handle_get_vts_command
def handle_get_vts_command(self, vt_et): """ Handles <get_vts> command. @return: Response string for <get_vts> command. """ vt_id = vt_et.attrib.get('vt_id') vt_filter = vt_et.attrib.get('filter') if vt_id and vt_id not in self.vts: text = "Failed to find v...
python
def handle_get_vts_command(self, vt_et): """ Handles <get_vts> command. @return: Response string for <get_vts> command. """ vt_id = vt_et.attrib.get('vt_id') vt_filter = vt_et.attrib.get('filter') if vt_id and vt_id not in self.vts: text = "Failed to find v...
[ "def", "handle_get_vts_command", "(", "self", ",", "vt_et", ")", ":", "vt_id", "=", "vt_et", ".", "attrib", ".", "get", "(", "'vt_id'", ")", "vt_filter", "=", "vt_et", ".", "attrib", ".", "get", "(", "'filter'", ")", "if", "vt_id", "and", "vt_id", "not...
Handles <get_vts> command. @return: Response string for <get_vts> command.
[ "Handles", "<get_vts", ">", "command", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L982-L1006
greenbone/ospd
ospd/ospd.py
OSPDaemon.handle_help_command
def handle_help_command(self, scan_et): """ Handles <help> command. @return: Response string for <help> command. """ help_format = scan_et.attrib.get('format') if help_format is None or help_format == "text": # Default help format is text. return simple_r...
python
def handle_help_command(self, scan_et): """ Handles <help> command. @return: Response string for <help> command. """ help_format = scan_et.attrib.get('format') if help_format is None or help_format == "text": # Default help format is text. return simple_r...
[ "def", "handle_help_command", "(", "self", ",", "scan_et", ")", ":", "help_format", "=", "scan_et", ".", "attrib", ".", "get", "(", "'format'", ")", "if", "help_format", "is", "None", "or", "help_format", "==", "\"text\"", ":", "# Default help format is text.", ...
Handles <help> command. @return: Response string for <help> command.
[ "Handles", "<help", ">", "command", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L1008-L1021
greenbone/ospd
ospd/ospd.py
OSPDaemon.get_help_text
def get_help_text(self): """ Returns the help output in plain text format.""" txt = str('\n') for name, info in self.commands.items(): command_txt = "\t{0: <22} {1}\n".format(name, info['description']) if info['attributes']: command_txt = ''.join([command...
python
def get_help_text(self): """ Returns the help output in plain text format.""" txt = str('\n') for name, info in self.commands.items(): command_txt = "\t{0: <22} {1}\n".format(name, info['description']) if info['attributes']: command_txt = ''.join([command...
[ "def", "get_help_text", "(", "self", ")", ":", "txt", "=", "str", "(", "'\\n'", ")", "for", "name", ",", "info", "in", "self", ".", "commands", ".", "items", "(", ")", ":", "command_txt", "=", "\"\\t{0: <22} {1}\\n\"", ".", "format", "(", "name", ",", ...
Returns the help output in plain text format.
[ "Returns", "the", "help", "output", "in", "plain", "text", "format", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L1023-L1038
greenbone/ospd
ospd/ospd.py
OSPDaemon.elements_as_text
def elements_as_text(self, elems, indent=2): """ Returns the elems dictionary as formatted plain text. """ assert elems text = "" for elename, eledesc in elems.items(): if isinstance(eledesc, dict): desc_txt = self.elements_as_text(eledesc, indent + 2) ...
python
def elements_as_text(self, elems, indent=2): """ Returns the elems dictionary as formatted plain text. """ assert elems text = "" for elename, eledesc in elems.items(): if isinstance(eledesc, dict): desc_txt = self.elements_as_text(eledesc, indent + 2) ...
[ "def", "elements_as_text", "(", "self", ",", "elems", ",", "indent", "=", "2", ")", ":", "assert", "elems", "text", "=", "\"\"", "for", "elename", ",", "eledesc", "in", "elems", ".", "items", "(", ")", ":", "if", "isinstance", "(", "eledesc", ",", "d...
Returns the elems dictionary as formatted plain text.
[ "Returns", "the", "elems", "dictionary", "as", "formatted", "plain", "text", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L1040-L1055
greenbone/ospd
ospd/ospd.py
OSPDaemon.handle_delete_scan_command
def handle_delete_scan_command(self, scan_et): """ Handles <delete_scan> command. @return: Response string for <delete_scan> command. """ scan_id = scan_et.attrib.get('scan_id') if scan_id is None: return simple_response_str('delete_scan', 404, ...
python
def handle_delete_scan_command(self, scan_et): """ Handles <delete_scan> command. @return: Response string for <delete_scan> command. """ scan_id = scan_et.attrib.get('scan_id') if scan_id is None: return simple_response_str('delete_scan', 404, ...
[ "def", "handle_delete_scan_command", "(", "self", ",", "scan_et", ")", ":", "scan_id", "=", "scan_et", ".", "attrib", ".", "get", "(", "'scan_id'", ")", "if", "scan_id", "is", "None", ":", "return", "simple_response_str", "(", "'delete_scan'", ",", "404", ",...
Handles <delete_scan> command. @return: Response string for <delete_scan> command.
[ "Handles", "<delete_scan", ">", "command", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L1057-L1073
greenbone/ospd
ospd/ospd.py
OSPDaemon.delete_scan
def delete_scan(self, scan_id): """ Deletes scan_id scan from collection. @return: 1 if scan deleted, 0 otherwise. """ if self.get_scan_status(scan_id) == ScanStatus.RUNNING: return 0 try: del self.scan_processes[scan_id] except KeyError: ...
python
def delete_scan(self, scan_id): """ Deletes scan_id scan from collection. @return: 1 if scan deleted, 0 otherwise. """ if self.get_scan_status(scan_id) == ScanStatus.RUNNING: return 0 try: del self.scan_processes[scan_id] except KeyError: ...
[ "def", "delete_scan", "(", "self", ",", "scan_id", ")", ":", "if", "self", ".", "get_scan_status", "(", "scan_id", ")", "==", "ScanStatus", ".", "RUNNING", ":", "return", "0", "try", ":", "del", "self", ".", "scan_processes", "[", "scan_id", "]", "except...
Deletes scan_id scan from collection. @return: 1 if scan deleted, 0 otherwise.
[ "Deletes", "scan_id", "scan", "from", "collection", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L1075-L1087
greenbone/ospd
ospd/ospd.py
OSPDaemon.get_scan_results_xml
def get_scan_results_xml(self, scan_id, pop_res): """ Gets scan_id scan's results in XML format. @return: String of scan results in xml. """ results = Element('results') for result in self.scan_collection.results_iterator(scan_id, pop_res): results.append(get_result_...
python
def get_scan_results_xml(self, scan_id, pop_res): """ Gets scan_id scan's results in XML format. @return: String of scan results in xml. """ results = Element('results') for result in self.scan_collection.results_iterator(scan_id, pop_res): results.append(get_result_...
[ "def", "get_scan_results_xml", "(", "self", ",", "scan_id", ",", "pop_res", ")", ":", "results", "=", "Element", "(", "'results'", ")", "for", "result", "in", "self", ".", "scan_collection", ".", "results_iterator", "(", "scan_id", ",", "pop_res", ")", ":", ...
Gets scan_id scan's results in XML format. @return: String of scan results in xml.
[ "Gets", "scan_id", "scan", "s", "results", "in", "XML", "format", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L1089-L1099
greenbone/ospd
ospd/ospd.py
OSPDaemon.get_xml_str
def get_xml_str(self, data): """ Creates a string in XML Format using the provided data structure. @param: Dictionary of xml tags and their elements. @return: String of data in xml format. """ responses = [] for tag, value in data.items(): elem = Element(ta...
python
def get_xml_str(self, data): """ Creates a string in XML Format using the provided data structure. @param: Dictionary of xml tags and their elements. @return: String of data in xml format. """ responses = [] for tag, value in data.items(): elem = Element(ta...
[ "def", "get_xml_str", "(", "self", ",", "data", ")", ":", "responses", "=", "[", "]", "for", "tag", ",", "value", "in", "data", ".", "items", "(", ")", ":", "elem", "=", "Element", "(", "tag", ")", "if", "isinstance", "(", "value", ",", "dict", "...
Creates a string in XML Format using the provided data structure. @param: Dictionary of xml tags and their elements. @return: String of data in xml format.
[ "Creates", "a", "string", "in", "XML", "Format", "using", "the", "provided", "data", "structure", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L1101-L1121
greenbone/ospd
ospd/ospd.py
OSPDaemon.get_scan_xml
def get_scan_xml(self, scan_id, detailed=True, pop_res=False): """ Gets scan in XML format. @return: String of scan in XML format. """ if not scan_id: return Element('scan') target = ','.join(self.get_scan_target(scan_id)) progress = self.get_scan_progress(s...
python
def get_scan_xml(self, scan_id, detailed=True, pop_res=False): """ Gets scan in XML format. @return: String of scan in XML format. """ if not scan_id: return Element('scan') target = ','.join(self.get_scan_target(scan_id)) progress = self.get_scan_progress(s...
[ "def", "get_scan_xml", "(", "self", ",", "scan_id", ",", "detailed", "=", "True", ",", "pop_res", "=", "False", ")", ":", "if", "not", "scan_id", ":", "return", "Element", "(", "'scan'", ")", "target", "=", "','", ".", "join", "(", "self", ".", "get_...
Gets scan in XML format. @return: String of scan in XML format.
[ "Gets", "scan", "in", "XML", "format", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L1123-L1146
greenbone/ospd
ospd/ospd.py
OSPDaemon.get_vt_xml
def get_vt_xml(self, vt_id): """ Gets a single vulnerability test information in XML format. @return: String of single vulnerability test information in XML format. """ if not vt_id: return Element('vt') vt = self.vts.get(vt_id) name = vt.get('name') ...
python
def get_vt_xml(self, vt_id): """ Gets a single vulnerability test information in XML format. @return: String of single vulnerability test information in XML format. """ if not vt_id: return Element('vt') vt = self.vts.get(vt_id) name = vt.get('name') ...
[ "def", "get_vt_xml", "(", "self", ",", "vt_id", ")", ":", "if", "not", "vt_id", ":", "return", "Element", "(", "'vt'", ")", "vt", "=", "self", ".", "vts", ".", "get", "(", "vt_id", ")", "name", "=", "vt", ".", "get", "(", "'name'", ")", "vt_xml",...
Gets a single vulnerability test information in XML format. @return: String of single vulnerability test information in XML format.
[ "Gets", "a", "single", "vulnerability", "test", "information", "in", "XML", "format", "." ]
train
https://github.com/greenbone/ospd/blob/cef773166b15a19c17764721d3fe404fa0e107bf/ospd/ospd.py#L1330-L1413