Code stringlengths 103 85.9k | Summary listlengths 0 94 |
|---|---|
Please provide a description of the function:def link(self, *args):
mr = RiakMapReduce(self.client)
mr.add(self.bucket.name, self.key)
return mr.link(*args) | [
"\n Start assembling a Map/Reduce operation.\n A shortcut for :meth:`~riak.mapreduce.RiakMapReduce.link`.\n\n :rtype: :class:`~riak.mapreduce.RiakMapReduce`\n "
] |
Please provide a description of the function:def get_encoder(self, content_type):
if content_type in self._encoders:
return self._encoders[content_type]
else:
return self._client.get_encoder(content_type) | [
"\n Get the encoding function for the provided content type for\n this bucket.\n\n :param content_type: the requested media type\n :type content_type: str\n :param content_type: Content type requested\n "
] |
Please provide a description of the function:def get_decoder(self, content_type):
if content_type in self._decoders:
return self._decoders[content_type]
else:
return self._client.get_decoder(content_type) | [
"\n Get the decoding function for the provided content type for\n this bucket.\n\n :param content_type: the requested media type\n :type content_type: str\n :rtype: function\n "
] |
Please provide a description of the function:def new(self, key=None, data=None, content_type='application/json',
encoded_data=None):
from riak import RiakObject
if self.bucket_type.datatype:
return TYPES[self.bucket_type.datatype](bucket=self, key=key)
if PY2:
... | [
"A shortcut for manually instantiating a new\n :class:`~riak.riak_object.RiakObject` or a new\n :class:`~riak.datatypes.Datatype`, based on the presence and value\n of the :attr:`datatype <BucketType.datatype>` bucket property. When\n the bucket contains a :class:`~riak.datatypes.Datatyp... |
Please provide a description of the function:def get(self, key, r=None, pr=None, timeout=None, include_context=None,
basic_quorum=None, notfound_ok=None, head_only=False):
from riak import RiakObject
if self.bucket_type.datatype:
return self._client.fetch_datatype(self, ... | [
"\n Retrieve a :class:`~riak.riak_object.RiakObject` or\n :class:`~riak.datatypes.Datatype`, based on the presence and value\n of the :attr:`datatype <BucketType.datatype>` bucket property.\n\n :param key: Name of the key.\n :type key: string\n :param r: R-Value of the requ... |
Please provide a description of the function:def multiget(self, keys, r=None, pr=None, timeout=None,
basic_quorum=None, notfound_ok=None,
head_only=False):
bkeys = [(self.bucket_type.name, self.name, key) for key in keys]
return self._client.multiget(bkeys, r=r... | [
"\n Retrieves a list of keys belonging to this bucket in parallel.\n\n :param keys: the keys to fetch\n :type keys: list\n :param r: R-Value for the requests (defaults to bucket's R)\n :type r: integer\n :param pr: PR-Value for the requests (defaults to bucket's PR)\n ... |
Please provide a description of the function:def new_from_file(self, key, filename):
binary_data = None
with open(filename, 'rb') as f:
binary_data = f.read()
mimetype, encoding = mimetypes.guess_type(filename)
if encoding:
binary_data = bytearray(binary_... | [
"Create a new Riak object in the bucket, using the contents of\n the specified file. This is a shortcut for :meth:`new`, where the\n ``encoded_data`` and ``content_type`` are set for you.\n\n .. warning:: This is not supported for buckets that contain\n :class:`Datatypes <riak.datatyp... |
Please provide a description of the function:def search(self, query, index=None, **params):
search_index = index or self.name
return self._client.fulltext_search(search_index, query, **params) | [
"\n Queries a search index over objects in this bucket/index. See\n :meth:`RiakClient.fulltext_search()\n <riak.client.RiakClient.fulltext_search>` for more details.\n\n :param query: the search query\n :type query: string\n :param index: the index to search over. Defaults ... |
Please provide a description of the function:def get_index(self, index, startkey, endkey=None, return_terms=None,
max_results=None, continuation=None, timeout=None,
term_regex=None):
return self._client.get_index(self, index, startkey, endkey,
... | [
"\n Queries a secondary index over objects in this bucket,\n returning keys or index/key pairs. See\n :meth:`RiakClient.get_index()\n <riak.client.RiakClient.get_index>` for more details.\n "
] |
Please provide a description of the function:def get_counter(self, key, **kwargs):
return self._client.get_counter(self, key, **kwargs) | [
"\n Gets the value of a counter stored in this bucket. See\n :meth:`RiakClient.get_counter()\n <riak.client.RiakClient.get_counter>` for options.\n\n .. deprecated:: 2.1.0 (Riak 2.0) Riak 1.4-style counters are\n deprecated in favor of the :class:`~riak.datatypes.Counter`\n ... |
Please provide a description of the function:def update_counter(self, key, value, **kwargs):
return self._client.update_counter(self, key, value, **kwargs) | [
"\n Updates the value of a counter stored in this bucket. Positive\n values increment the counter, negative values decrement. See\n :meth:`RiakClient.update_counter()\n <riak.client.RiakClient.update_counter>` for options.\n\n .. deprecated:: 2.1.0 (Riak 2.0) Riak 1.4-style counte... |
Please provide a description of the function:def get_buckets(self, timeout=None):
return self._client.get_buckets(bucket_type=self, timeout=timeout) | [
"\n Get the list of buckets under this bucket-type as\n :class:`RiakBucket <riak.bucket.RiakBucket>` instances.\n\n .. warning:: Do not use this in production, as it requires\n traversing through all keys stored in a cluster.\n\n .. note:: This request is automatically retried ... |
Please provide a description of the function:def stream_buckets(self, timeout=None):
return self._client.stream_buckets(bucket_type=self, timeout=timeout) | [
"\n Streams the list of buckets under this bucket-type. This is a\n generator method that should be iterated over.\n\n The caller must close the stream when finished. See\n :meth:`RiakClient.stream_buckets()\n <riak.client.RiakClient.stream_buckets>` for more details.\n\n ... |
Please provide a description of the function:def incr(self, d):
with self.lock:
self.p = self.value() + d | [
"\n Increases the value by the argument.\n\n :param d: the value to increase by\n :type d: float\n "
] |
Please provide a description of the function:def value(self):
with self.lock:
now = time.time()
dt = now - self.t0
self.t0 = now
self.p = self.p * (math.pow(self.e, self.r * dt))
return self.p | [
"\n Returns the current value (adjusted for the time decay)\n\n :rtype: float\n "
] |
Please provide a description of the function:def make_random_client_id(self):
if PY2:
return ('py_%s' %
base64.b64encode(str(random.randint(1, 0x40000000))))
else:
return ('py_%s' %
base64.b64encode(bytes(str(random.randint(1, 0x40... | [
"\n Returns a random client identifier\n "
] |
Please provide a description of the function:def make_fixed_client_id(self):
machine = platform.node()
process = os.getpid()
thread = threading.currentThread().getName()
return base64.b64encode('%s|%s|%s' % (machine, process, thread)) | [
"\n Returns a unique identifier for the current machine/process/thread.\n "
] |
Please provide a description of the function:def get(self, robj, r=None, pr=None, timeout=None, basic_quorum=None,
notfound_ok=None, head_only=False):
raise NotImplementedError | [
"\n Fetches an object.\n "
] |
Please provide a description of the function:def put(self, robj, w=None, dw=None, pw=None, return_body=None,
if_none_match=None, timeout=None):
raise NotImplementedError | [
"\n Stores an object.\n "
] |
Please provide a description of the function:def delete(self, robj, rw=None, r=None, w=None, dw=None, pr=None,
pw=None, timeout=None):
raise NotImplementedError | [
"\n Deletes an object.\n "
] |
Please provide a description of the function:def get_index(self, bucket, index, startkey, endkey=None,
return_terms=None, max_results=None, continuation=None,
timeout=None, term_regex=None):
raise NotImplementedError | [
"\n Performs a secondary index query.\n "
] |
Please provide a description of the function:def stream_index(self, bucket, index, startkey, endkey=None,
return_terms=None, max_results=None, continuation=None,
timeout=None):
raise NotImplementedError | [
"\n Streams a secondary index query.\n "
] |
Please provide a description of the function:def update_counter(self, bucket, key, value, w=None, dw=None, pw=None,
returnvalue=False):
raise NotImplementedError | [
"\n Updates a counter by the given value.\n "
] |
Please provide a description of the function:def fetch_datatype(self, bucket, key, r=None, pr=None, basic_quorum=None,
notfound_ok=None, timeout=None, include_context=None):
raise NotImplementedError | [
"\n Fetches a Riak Datatype.\n "
] |
Please provide a description of the function:def update_datatype(self, datatype, w=None, dw=None, pw=None,
return_body=None, timeout=None, include_context=None):
raise NotImplementedError | [
"\n Updates a Riak Datatype by sending local operations to the server.\n "
] |
Please provide a description of the function:def _search_mapred_emu(self, index, query):
phases = []
if not self.phaseless_mapred():
phases.append({'language': 'erlang',
'module': 'riak_kv_mapreduce',
'function': 'reduce_identity... | [
"\n Emulates a search request via MapReduce. Used in the case\n where the transport supports MapReduce but has no native\n search capability.\n "
] |
Please provide a description of the function:def _get_index_mapred_emu(self, bucket, index, startkey, endkey=None):
phases = []
if not self.phaseless_mapred():
phases.append({'language': 'erlang',
'module': 'riak_kv_mapreduce',
'... | [
"\n Emulates a secondary index request via MapReduce. Used in the\n case where the transport supports MapReduce but has no native\n secondary index query capability.\n "
] |
Please provide a description of the function:def _parse_body(self, robj, response, expected_statuses):
# If no response given, then return.
if response is None:
return None
status, headers, data = response
# Check if the server is down(status==0)
if not sta... | [
"\n Parse the body of an object response and populate the object.\n "
] |
Please provide a description of the function:def _parse_sibling(self, sibling, headers, data):
sibling.exists = True
# Parse the headers...
for header, value in headers:
header = header.lower()
if header == 'content-type':
sibling.content_type, ... | [
"\n Parses a single sibling out of a response.\n "
] |
Please provide a description of the function:def _to_link_header(self, link):
try:
bucket, key, tag = link
except ValueError:
raise RiakError("Invalid link tuple %s" % link)
tag = tag if tag is not None else bucket
url = self.object_path(bucket, key)
... | [
"\n Convert the link tuple to a link header string. Used internally.\n "
] |
Please provide a description of the function:def _build_put_headers(self, robj, if_none_match=False):
# Construct the headers...
if robj.charset is not None:
content_type = ('%s; charset="%s"' %
(robj.content_type, robj.charset))
else:
... | [
"Build the headers for a POST/PUT request."
] |
Please provide a description of the function:def _normalize_json_search_response(self, json):
result = {}
if 'facet_counts' in json:
result['facet_counts'] = json[u'facet_counts']
if 'grouped' in json:
result['grouped'] = json[u'grouped']
if 'stats' in js... | [
"\n Normalizes a JSON search response so that PB and HTTP have the\n same return value\n "
] |
Please provide a description of the function:def _normalize_xml_search_response(self, xml):
target = XMLSearchResult()
parser = ElementTree.XMLParser(target=target)
parser.feed(xml)
return parser.close() | [
"\n Normalizes an XML search response so that PB and HTTP have the\n same return value\n "
] |
Please provide a description of the function:def _parse_content_type(self, value):
content_type, params = parse_header(value)
if 'charset' in params:
charset = params['charset']
else:
charset = None
return content_type, charset | [
"\n Split the content-type header into two parts:\n 1) Actual main/sub encoding type\n 2) charset\n\n :param value: Complete MIME content-type string\n "
] |
Please provide a description of the function:def connect(self):
HTTPConnection.connect(self)
self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) | [
"\n Set TCP_NODELAY on socket\n "
] |
Please provide a description of the function:def connect(self):
sock = socket.create_connection((self.host, self.port), self.timeout)
if not USE_STDLIB_SSL:
ssl_ctx = configure_pyopenssl_context(self.credentials)
# attempt to upgrade the socket to TLS
cxn = ... | [
"\n Connect to a host on a given (SSL) port using PyOpenSSL.\n "
] |
Please provide a description of the function:def retryable(fn, protocol=None):
def wrapper(self, *args, **kwargs):
pool = self._choose_pool(protocol)
def thunk(transport):
return fn(self, transport, *args, **kwargs)
return self._with_retries(pool, thunk)
wrapper.__doc... | [
"\n Wraps a client operation that can be retried according to the set\n :attr:`RiakClient.retries`. Used internally.\n "
] |
Please provide a description of the function:def retry_count(self, retries):
if not isinstance(retries, int):
raise TypeError("retries must be an integer")
old_retries, self.retries = self.retries, retries
try:
yield
finally:
self.retries = o... | [
"\n retry_count(retries)\n\n Modifies the number of retries for the scope of the ``with``\n statement (in the current thread).\n\n Example::\n\n with client.retry_count(10):\n client.ping()\n "
] |
Please provide a description of the function:def _with_retries(self, pool, fn):
skip_nodes = []
def _skip_bad_nodes(transport):
return transport._node not in skip_nodes
retry_count = self.retries - 1
first_try = True
current_try = 0
while True:
... | [
"\n Performs the passed function with retries against the given pool.\n\n :param pool: the connection pool to use\n :type pool: Pool\n :param fn: the function to pass a transport\n :type fn: function\n "
] |
Please provide a description of the function:def _choose_pool(self, protocol=None):
if not protocol:
protocol = self.protocol
if protocol == 'http':
pool = self._http_pool
elif protocol == 'tcp' or protocol == 'pbc':
pool = self._tcp_pool
else... | [
"\n Selects a connection pool according to the default protocol\n and the passed one.\n\n :param protocol: the protocol to use\n :type protocol: string\n :rtype: Pool\n "
] |
Please provide a description of the function:def default_encoder(obj):
if isinstance(obj, bytes):
return json.dumps(bytes_to_str(obj),
ensure_ascii=False).encode("utf-8")
else:
return json.dumps(obj, ensure_ascii=False).encode("utf-8") | [
"\n Default encoder for JSON datatypes, which returns UTF-8 encoded\n json instead of the default bloated backslash u XXXX escaped ASCII strings.\n "
] |
Please provide a description of the function:def bucket(self, name, bucket_type='default'):
if not isinstance(name, string_types):
raise TypeError('Bucket name must be a string')
if isinstance(bucket_type, string_types):
bucket_type = self.bucket_type(bucket_type)
... | [
"\n Get the bucket by the specified name. Since buckets always exist,\n this will always return a\n :class:`RiakBucket <riak.bucket.RiakBucket>`.\n\n If you are using a bucket that is contained in a bucket type, it is\n preferable to access it from the bucket type object::\n\n ... |
Please provide a description of the function:def bucket_type(self, name):
if not isinstance(name, string_types):
raise TypeError('BucketType name must be a string')
btype = BucketType(self, name)
return self._setdefault_handle_none(
self._bucket_types, name,... | [
"\n Gets the bucket-type by the specified name. Bucket-types do\n not always exist (unlike buckets), but this will always return\n a :class:`BucketType <riak.bucket.BucketType>` object.\n\n :param name: the bucket-type name\n :type name: str\n :rtype: :class:`BucketType <ri... |
Please provide a description of the function:def table(self, name):
if not isinstance(name, string_types):
raise TypeError('Table name must be a string')
if name in self._tables:
return self._tables[name]
else:
table = Table(self, name)
s... | [
"\n Gets the table by the specified name. Tables do\n not always exist (unlike buckets), but this will always return\n a :class:`Table <riak.table.Table>` object.\n\n :param name: the table name\n :type name: str\n :rtype: :class:`Table <riak.table.Table>`\n "
] |
Please provide a description of the function:def close(self):
if not self._closed:
self._closed = True
self._stop_multi_pools()
if self._http_pool is not None:
self._http_pool.clear()
self._http_pool = None
if self._tcp_poo... | [
"\n Iterate through all of the connections and close each one.\n "
] |
Please provide a description of the function:def _create_credentials(self, n):
if not n:
return n
elif isinstance(n, SecurityCreds):
return n
elif isinstance(n, dict):
return SecurityCreds(**n)
else:
raise TypeError("%s is not a va... | [
"\n Create security credentials, if necessary.\n "
] |
Please provide a description of the function:def _choose_node(self, nodes=None):
if not nodes:
nodes = self.nodes
# Prefer nodes which have gone a reasonable time without
# errors
def _error_rate(node):
return node.error_rate.value()
good = [n f... | [
"\n Chooses a random node from the list of nodes in the client,\n taking into account each node's recent error rate.\n :rtype RiakNode\n "
] |
Please provide a description of the function:def _request(self, method, uri, headers={}, body='', stream=False):
response = None
headers.setdefault('Accept',
'multipart/mixed, application/json, */*;q=0.5')
if self._client._credentials:
self._secur... | [
"\n Given a Method, URL, Headers, and Body, perform and HTTP\n request, and return a 3-tuple containing the response status,\n response headers (as httplib.HTTPMessage), and response body.\n "
] |
Please provide a description of the function:def _connect(self):
timeout = None
if self._options is not None and 'timeout' in self._options:
timeout = self._options['timeout']
if self._client._credentials:
self._connection = self._connection_class(
... | [
"\n Use the appropriate connection class; optionally with security.\n "
] |
Please provide a description of the function:def _security_auth_headers(self, username, password, headers):
userColonPassword = username + ":" + password
b64UserColonPassword = base64. \
b64encode(str_to_bytes(userColonPassword)).decode("ascii")
headers['Authorization'] = 'B... | [
"\n Add in the requisite HTTP Authentication Headers\n\n :param username: Riak Security Username\n :type str\n :param password: Riak Security Password\n :type str\n :param headers: Dictionary of headers\n :type dict\n "
] |
Please provide a description of the function:def new(self, rows, columns=None):
from riak.ts_object import TsObject
return TsObject(self._client, self, rows, columns) | [
"\n A shortcut for manually instantiating a new\n :class:`~riak.ts_object.TsObject`\n\n :param rows: An list of lists with timeseries data\n :type rows: list\n :param columns: An list of Column names and types. Optional.\n :type columns: list\n :rtype: :class:`~riak.... |
Please provide a description of the function:def query(self, query, interpolations=None):
return self._client.ts_query(self, query, interpolations) | [
"\n Queries a timeseries table.\n\n :param query: The timeseries query.\n :type query: string\n :rtype: :class:`TsObject <riak.ts_object.TsObject>`\n "
] |
Please provide a description of the function:def getConfigDirectory():
if platform.system() == 'Windows':
return os.path.join(os.environ['APPDATA'], 'ue4cli')
else:
return os.path.join(os.environ['HOME'], '.config', 'ue4cli') | [
"\n\t\tDetermines the platform-specific config directory location for ue4cli\n\t\t"
] |
Please provide a description of the function:def setConfigKey(key, value):
configFile = ConfigurationManager._configFile()
return JsonDataManager(configFile).setKey(key, value) | [
"\n\t\tSets the config data value for the specified dictionary key\n\t\t"
] |
Please provide a description of the function:def clearCache():
if os.path.exists(CachedDataManager._cacheDir()) == True:
shutil.rmtree(CachedDataManager._cacheDir()) | [
"\n\t\tClears any cached data we have stored about specific engine versions\n\t\t"
] |
Please provide a description of the function:def getCachedDataKey(engineVersionHash, key):
cacheFile = CachedDataManager._cacheFileForHash(engineVersionHash)
return JsonDataManager(cacheFile).getKey(key) | [
"\n\t\tRetrieves the cached data value for the specified engine version hash and dictionary key\n\t\t"
] |
Please provide a description of the function:def setCachedDataKey(engineVersionHash, key, value):
cacheFile = CachedDataManager._cacheFileForHash(engineVersionHash)
return JsonDataManager(cacheFile).setKey(key, value) | [
"\n\t\tSets the cached data value for the specified engine version hash and dictionary key\n\t\t"
] |
Please provide a description of the function:def writeFile(filename, data):
with open(filename, 'wb') as f:
f.write(data.encode('utf-8')) | [
"\n\t\tWrites data to a file\n\t\t"
] |
Please provide a description of the function:def patchFile(filename, replacements):
patched = Utility.readFile(filename)
# Perform each of the replacements in the supplied dictionary
for key in replacements:
patched = patched.replace(key, replacements[key])
Utility.writeFile(filename, patched) | [
"\n\t\tApplies the supplied list of replacements to a file\n\t\t"
] |
Please provide a description of the function:def escapePathForShell(path):
if platform.system() == 'Windows':
return '"{}"'.format(path.replace('"', '""'))
else:
return shellescape.quote(path) | [
"\n\t\tEscapes a filesystem path for use as a command-line argument\n\t\t"
] |
Please provide a description of the function:def stripArgs(args, blacklist):
blacklist = [b.lower() for b in blacklist]
return list([arg for arg in args if arg.lower() not in blacklist]) | [
"\n\t\tRemoves any arguments in the supplied list that are contained in the specified blacklist\n\t\t"
] |
Please provide a description of the function:def capture(command, input=None, cwd=None, shell=False, raiseOnError=False):
# Attempt to execute the child process
proc = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd, shell=shell, universal_newlines=True... | [
"\n\t\tExecutes a child process and captures its output\n\t\t"
] |
Please provide a description of the function:def run(command, cwd=None, shell=False, raiseOnError=False):
returncode = subprocess.call(command, cwd=cwd, shell=shell)
if raiseOnError == True and returncode != 0:
raise Exception('child process ' + str(command) + ' failed with exit code ' + str(returncode))
re... | [
"\n\t\tExecutes a child process and waits for it to complete\n\t\t"
] |
Please provide a description of the function:def setEngineRootOverride(self, rootDir):
# Set the new root directory
ConfigurationManager.setConfigKey('rootDirOverride', os.path.abspath(rootDir))
# Check that the specified directory is valid and warn the user if it is not
try:
self.getEngineVersion... | [
"\n\t\tSets a user-specified directory as the root engine directory, overriding any auto-detection\n\t\t"
] |
Please provide a description of the function:def getEngineRoot(self):
if not hasattr(self, '_engineRoot'):
self._engineRoot = self._getEngineRoot()
return self._engineRoot | [
"\n\t\tReturns the root directory location of the latest installed version of UE4\n\t\t"
] |
Please provide a description of the function:def getEngineVersion(self, outputFormat = 'full'):
version = self._getEngineVersionDetails()
formats = {
'major': version['MajorVersion'],
'minor': version['MinorVersion'],
'patch': version['PatchVersion'],
'full': '{}.{}.{}'.format(version['MajorVersion']... | [
"\n\t\tReturns the version number of the latest installed version of UE4\n\t\t"
] |
Please provide a description of the function:def getEngineChangelist(self):
# Newer versions of the engine use the key "CompatibleChangelist", older ones use "Changelist"
version = self._getEngineVersionDetails()
if 'CompatibleChangelist' in version:
return int(version['CompatibleChangelist'])
else:
... | [
"\n\t\tReturns the compatible Perforce changelist identifier for the latest installed version of UE4\n\t\t"
] |
Please provide a description of the function:def isInstalledBuild(self):
sentinelFile = os.path.join(self.getEngineRoot(), 'Engine', 'Build', 'InstalledBuild.txt')
return os.path.exists(sentinelFile) | [
"\n\t\tDetermines if the Engine is an Installed Build\n\t\t"
] |
Please provide a description of the function:def getEditorBinary(self, cmdVersion=False):
return os.path.join(self.getEngineRoot(), 'Engine', 'Binaries', self.getPlatformIdentifier(), 'UE4Editor' + self._editorPathSuffix(cmdVersion)) | [
"\n\t\tDetermines the location of the UE4Editor binary\n\t\t"
] |
Please provide a description of the function:def getProjectDescriptor(self, dir):
for project in glob.glob(os.path.join(dir, '*.uproject')):
return os.path.realpath(project)
# No project detected
raise UnrealManagerException('could not detect an Unreal project in the current directory') | [
"\n\t\tDetects the .uproject descriptor file for the Unreal project in the specified directory\n\t\t"
] |
Please provide a description of the function:def getPluginDescriptor(self, dir):
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 plugin in the current directory') | [
"\n\t\tDetects the .uplugin descriptor file for the Unreal plugin in the specified directory\n\t\t"
] |
Please provide a description of the function:def getDescriptor(self, dir):
try:
return self.getProjectDescriptor(dir)
except:
try:
return self.getPluginDescriptor(dir)
except:
raise UnrealManagerException('could not detect an Unreal project or plugin in the directory "{}"'.format(dir)) | [
"\n\t\tDetects the descriptor file for either an Unreal project or an Unreal plugin in the specified directory\n\t\t"
] |
Please provide a description of the function:def listThirdPartyLibs(self, configuration = 'Development'):
interrogator = self._getUE4BuildInterrogator()
return interrogator.list(self.getPlatformIdentifier(), configuration, self._getLibraryOverrides()) | [
"\n\t\tLists the supported Unreal-bundled third-party libraries\n\t\t"
] |
Please provide a description of the function:def getThirdpartyLibs(self, libs, configuration = 'Development', includePlatformDefaults = True):
if includePlatformDefaults == True:
libs = self._defaultThirdpartyLibs() + libs
interrogator = self._getUE4BuildInterrogator()
return interrogator.interrogate(self.g... | [
"\n\t\tRetrieves the ThirdPartyLibraryDetails instance for Unreal-bundled versions of the specified third-party libraries\n\t\t"
] |
Please provide a description of the function:def getThirdPartyLibCompilerFlags(self, libs):
fmt = PrintingFormat.singleLine()
if libs[0] == '--multiline':
fmt = PrintingFormat.multiLine()
libs = libs[1:]
platformDefaults = True
if libs[0] == '--nodefaults':
platformDefaults = False
libs = libs... | [
"\n\t\tRetrieves the compiler flags for building against the Unreal-bundled versions of the specified third-party libraries\n\t\t"
] |
Please provide a description of the function:def getThirdPartyLibLinkerFlags(self, libs):
fmt = PrintingFormat.singleLine()
if libs[0] == '--multiline':
fmt = PrintingFormat.multiLine()
libs = libs[1:]
includeLibs = True
if (libs[0] == '--flagsonly'):
includeLibs = False
libs = libs[1:]
p... | [
"\n\t\tRetrieves the linker flags for building against the Unreal-bundled versions of the specified third-party libraries\n\t\t"
] |
Please provide a description of the function:def getThirdPartyLibCmakeFlags(self, libs):
fmt = PrintingFormat.singleLine()
if libs[0] == '--multiline':
fmt = PrintingFormat.multiLine()
libs = libs[1:]
platformDefaults = True
if libs[0] == '--nodefaults':
platformDefaults = False
libs = libs[1:... | [
"\n\t\tRetrieves the CMake invocation flags for building against the Unreal-bundled versions of the specified third-party libraries\n\t\t"
] |
Please provide a description of the function:def getThirdPartyLibIncludeDirs(self, libs):
platformDefaults = True
if libs[0] == '--nodefaults':
platformDefaults = False
libs = libs[1:]
details = self.getThirdpartyLibs(libs, includePlatformDefaults=platformDefaults)
return details.getIncludeDirectori... | [
"\n\t\tRetrieves the list of include directories for building against the Unreal-bundled versions of the specified third-party libraries\n\t\t"
] |
Please provide a description of the function:def getThirdPartyLibFiles(self, libs):
platformDefaults = True
if libs[0] == '--nodefaults':
platformDefaults = False
libs = libs[1:]
details = self.getThirdpartyLibs(libs, includePlatformDefaults=platformDefaults)
return details.getLibraryFiles(self.getE... | [
"\n\t\tRetrieves the list of library files for building against the Unreal-bundled versions of the specified third-party libraries\n\t\t"
] |
Please provide a description of the function:def getThirdPartyLibDefinitions(self, libs):
platformDefaults = True
if libs[0] == '--nodefaults':
platformDefaults = False
libs = libs[1:]
details = self.getThirdpartyLibs(libs, includePlatformDefaults=platformDefaults)
return details.getPreprocessorDefi... | [
"\n\t\tRetrieves the list of preprocessor definitions for building against the Unreal-bundled versions of the specified third-party libraries\n\t\t"
] |
Please provide a description of the function: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(os.path.join(dir, 'Source')) == False:
Utility.printStderr('Pure Blueprint project, nothing to generat... | [
"\n\t\tGenerates IDE project files for the Unreal project in the specified directory\n\t\t"
] |
Please provide a description of the function: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 clean will also delete the engine build itself when using
# a source build, we... | [
"\n\t\tCleans the build artifacts for the Unreal project or plugin in the specified directory\n\t\t"
] |
Please provide a description of the function:def buildDescriptor(self, dir=os.getcwd(), configuration='Development', args=[], suppressOutput=False):
# Verify that an Unreal project or plugin exists in the specified directory
descriptor = self.getDescriptor(dir)
descriptorType = 'project' if self.isProject(d... | [
"\n\t\tBuilds the editor modules for the Unreal project or plugin in the specified directory, using the specified build configuration\n\t\t"
] |
Please provide a description of the function:def runEditor(self, dir=os.getcwd(), debug=False, args=[]):
projectFile = self.getProjectDescriptor(dir) if dir is not None else ''
extraFlags = ['-debug'] + args if debug == True else args
Utility.run([self.getEditorBinary(True), projectFile, '-stdout', '-FullStdOu... | [
"\n\t\tRuns the editor for the Unreal project in the specified directory (or without a project if dir is None)\n\t\t"
] |
Please provide a description of the function:def runUAT(self, args):
Utility.run([self.getRunUATScript()] + args, cwd=self.getEngineRoot(), raiseOnError=True) | [
"\n\t\tRuns the Unreal Automation Tool with the supplied arguments\n\t\t"
] |
Please provide a description of the function:def packageProject(self, dir=os.getcwd(), configuration='Shipping', extraArgs=[]):
# Verify that the specified build configuration is valid
if configuration not in self.validBuildConfigurations():
raise UnrealManagerException('invalid build configuration "' + co... | [
"\n\t\tPackages a build of the Unreal project in the specified directory, using common packaging options\n\t\t"
] |
Please provide a description of the function:def packagePlugin(self, dir=os.getcwd(), extraArgs=[]):
# Invoke UAT to package the build
distDir = os.path.join(os.path.abspath(dir), 'dist')
self.runUAT([
'BuildPlugin',
'-Plugin=' + self.getPluginDescriptor(dir),
'-Package=' + distDir
] + extraArgs) | [
"\n\t\tPackages a build of the Unreal plugin in the specified directory, suitable for use as a prebuilt Engine module\n\t\t"
] |
Please provide a description of the function:def packageDescriptor(self, dir=os.getcwd(), args=[]):
# Verify that an Unreal project or plugin exists in the specified directory
descriptor = self.getDescriptor(dir)
# Perform the packaging step
if self.isProject(descriptor):
self.packageProject(dir, ar... | [
"\n\t\tPackages a build of the Unreal project or plugin in the specified directory\n\t\t"
] |
Please provide a description of the function: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 strin... | [] |
Please provide a description of the function:def _getEngineRoot(self):
override = ConfigurationManager.getConfigKey('rootDirOverride')
if override != None:
Utility.printStderr('Using user-specified engine root: ' + override)
return override
else:
return self._detectEngineRoot() | [
"\n\t\tRetrieves the user-specified engine root directory override (if set), or else performs auto-detection\n\t\t"
] |
Please provide a description of the function:def _getEngineVersionDetails(self):
versionFile = os.path.join(self.getEngineRoot(), 'Engine', 'Build', 'Build.version')
return json.loads(Utility.readFile(versionFile)) | [
"\n\t\tParses the JSON version details for the latest installed version of UE4\n\t\t"
] |
Please provide a description of the function:def _getEngineVersionHash(self):
versionDetails = self._getEngineVersionDetails()
hash = hashlib.sha256()
hash.update(json.dumps(versionDetails, sort_keys=True, indent=0).encode('utf-8'))
return hash.hexdigest() | [
"\n\t\tComputes the SHA-256 hash of the JSON version details for the latest installed version of UE4\n\t\t"
] |
Please provide a description of the function:def _runUnrealBuildTool(self, target, platform, configuration, args, capture=False):
platform = self._transformBuildToolPlatform(platform)
arguments = [self.getBuildScript(), target, platform, configuration] + args
if capture == True:
return Utility.capture(argum... | [
"\n\t\tInvokes UnrealBuildTool with the specified parameters\n\t\t"
] |
Please provide a description of the function:def _getUE4BuildInterrogator(self):
ubtLambda = lambda target, platform, config, args: self._runUnrealBuildTool(target, platform, config, args, True)
interrogator = UE4BuildInterrogator(self.getEngineRoot(), self._getEngineVersionDetails(), self._getEngineVersionHash(... | [
"\n\t\tUses UE4BuildInterrogator to interrogate UnrealBuildTool about third-party library details\n\t\t"
] |
Please provide a description of the function:def getKey(self, key):
data = self.getDictionary()
if key in data:
return data[key]
else:
return None | [
"\n\t\tRetrieves the value for the specified dictionary key\n\t\t"
] |
Please provide a description of the function:def getDictionary(self):
if os.path.exists(self.jsonFile):
return json.loads(Utility.readFile(self.jsonFile))
else:
return {} | [
"\n\t\tRetrieves the entire data dictionary\n\t\t"
] |
Please provide a description of the function:def setKey(self, key, value):
data = self.getDictionary()
data[key] = value
self.setDictionary(data) | [
"\n\t\tSets the value for the specified dictionary key\n\t\t"
] |
Please provide a description of the function: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(jsonDir) == False:
os.makedirs(jsonDir)
# Store the dictionary
Utility.writeFile(self.j... | [
"\n\t\tOverwrites the entire dictionary\n\t\t"
] |
Please provide a description of the function:def list(self, platformIdentifier, configuration, libOverrides = {}):
modules = self._getThirdPartyLibs(platformIdentifier, configuration)
return sorted([m['Name'] for m in modules] + [key for key in libOverrides]) | [
"\n\t\tReturns the list of supported UE4-bundled third-party libraries\n\t\t"
] |
Please provide a description of the function:def interrogate(self, platformIdentifier, configuration, libraries, libOverrides = {}):
# Determine which libraries need their modules parsed by UBT, and which are override-only
libModules = list([lib for lib in libraries if lib not in libOverrides])
# Check t... | [
"\n\t\tInterrogates UnrealBuildTool about the build flags for the specified third-party libraries\n\t\t"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.