text stringlengths 81 112k |
|---|
List all filter options defined on class (and superclasses)
def get_filter_options(cls):
"""
List all filter options defined on class (and superclasses)
"""
attr = '_filter_options_%s' % id(cls)
options = getattr(cls, attr, {})
if options:
return options
... |
Retrieve given property from class/instance, ensuring it is a list.
Also determine whether the list contains simple text/numeric values or
nested dictionaries (a "complex" list)
def getlist(self, name):
"""
Retrieve given property from class/instance, ensuring it is a list.
Also... |
Set parameter key, noting whether list value is "complex"
def set_param(self, into, name):
"""
Set parameter key, noting whether list value is "complex"
"""
value, complex = self.getlist(name)
if value is not None:
into[name] = value
return complex |
Get parameters for web service, noting whether any are "complex"
def get_params(self):
"""
Get parameters for web service, noting whether any are "complex"
"""
params = {}
complex = False
for name, opt in self.filter_options.items():
if opt.ignored:
... |
URL parameters for wq.io.loaders.NetLoader
def params(self):
"""
URL parameters for wq.io.loaders.NetLoader
"""
params, complex = self.get_params()
url_params = self.default_params.copy()
url_params.update(self.serialize_params(params, complex))
return url_params |
Serialize parameter names and values to a dict ready for urlencode()
def serialize_params(self, params, complex=False):
"""
Serialize parameter names and values to a dict ready for urlencode()
"""
if complex:
# See climata.acis for an example implementation
raise... |
convert the measurement to inches
def get_inches(self):
''' convert the measurement to inches '''
if self._obs_value in self.MISSING:
return 'MISSING'
if self._obs_units == self.MILLIMETERS:
return round(self.INCH_CONVERSION_FACTOR * self._obs_value, 4) |
print a nicely formatted output of this report
def formatted(self):
''' print a nicely formatted output of this report '''
return """
Weather Station: %s (%s, %s)
Elevation: %s m
Time: %s UTC
Air Temperature: %s C (%s F)
Wind Speed: %s m/s (%s mph)
Wind Direction: %s
Present Weather Obs: %s
Precipitation: %s
... |
load in a report (or set) from a string
def loads(self, noaa_string):
''' load in a report (or set) from a string '''
self.raw = noaa_string
self.weather_station = noaa_string[4:10]
self.wban = noaa_string[10:15]
expected_length = int(noaa_string[0:4]) + self.PREAMBLE_LENGTH
actual_length = len... |
Parse the remarks into the _remarks dict
def _get_remarks_component(self, string, initial_pos):
''' Parse the remarks into the _remarks dict '''
remarks_code = string[initial_pos:initial_pos + self.ADDR_CODE_LENGTH]
if remarks_code != 'REM':
raise ish_reportException("Parsing remarks. Expected REM bu... |
given a string and a position, return both an updated position and
either a Component Object or a String back to the caller
def _get_component(self, string, initial_pos):
''' given a string and a position, return both an updated position and
either a Component Object or a String back to the caller '''
... |
load from a string
def loads(self, string):
''' load from a string '''
for line in string.split("\n"):
if len(line) < 10:
continue
try:
report = ish_report()
report.loads(line)
self._reports.append(report)
except BaseException as exp:
''' don't complai... |
return only specific weather observations (FM types) and
ignore the summary of day reports
def get_observations(self):
''' return only specific weather observations (FM types) and
ignore the summary of day reports '''
return [rpt for rpt in self._reports if rpt.report_type in self.OBS_TYPES] |
convert the measurement to inches
def get_miles(self):
''' convert the measurement to inches '''
if self._obs_value in self.MISSING:
return 'MISSING'
if self._obs_units == self.METERSPERSECOND:
return round(2.23694 * self._obs_value, 4) |
Sync the template with the python code.
def do_pot(self):
"""
Sync the template with the python code.
"""
files_to_translate = []
log.debug("Collecting python sources for pot ...")
for source_path in self._source_paths:
for source_path in self._iter_suffix(pa... |
Update all po files with the data in the pot reference file.
def do_po(self):
"""
Update all po files with the data in the pot reference file.
"""
log.debug("Start updating po files ...")
pot_path = (self._po_path / self._basename).with_suffix(".pot")
for po_dir_path in ... |
Generate mo files for all po files.
def do_mo(self):
"""
Generate mo files for all po files.
"""
log.debug("Start updating mo files ...")
for po_dir_path in self._iter_po_dir():
po_path = (po_dir_path / self._basename).with_suffix(".po")
lc_path = self._m... |
Runs the worker and consumes messages from RabbitMQ.
Returns only after `shutdown()` is called.
def run(self) -> None:
"""Runs the worker and consumes messages from RabbitMQ.
Returns only after `shutdown()` is called.
"""
if self._logging_level:
logging.basicConfig(... |
Processes the message received from the queue.
def _process_message(self, message: amqp.Message) -> None:
"""Processes the message received from the queue."""
if self.shutdown_pending.is_set():
return
try:
if isinstance(message.body, bytes):
message.body... |
Logs the time spent while running the task.
def _apply_task(task: Task, args: Tuple, kwargs: Dict[str, Any]) -> Any:
"""Logs the time spent while running the task."""
if args is None:
args = ()
if kwargs is None:
kwargs = {}
start = monotonic()
try:
... |
Counts down from MAX_WORKER_RUN_TIME. When it reaches zero sutdown
gracefully.
def _shutdown_timer(self) -> None:
"""Counts down from MAX_WORKER_RUN_TIME. When it reaches zero sutdown
gracefully.
"""
remaining = self._max_run_time - self.uptime
if not self.shutdown_pend... |
Shutdown after processing current task.
def _handle_sigint(self, signum: int, frame: Any) -> None:
"""Shutdown after processing current task."""
logger.warning("Catched SIGINT")
self.shutdown() |
Used internally to fail the task when connection to RabbitMQ is
lost during the execution of the task.
def _handle_sighup(self, signum: int, frame: Any) -> None:
"""Used internally to fail the task when connection to RabbitMQ is
lost during the execution of the task.
"""
logger... |
Print stacktrace.
def _handle_sigusr1(signum: int, frame: Any) -> None:
"""Print stacktrace."""
print('=' * 70)
print(''.join(traceback.format_stack()))
print('-' * 70) |
Drop current task.
def _handle_sigusr2(self, signum: int, frame: Any) -> None:
"""Drop current task."""
logger.warning("Catched SIGUSR2")
if self.current_task:
logger.warning("Dropping current task...")
raise Discard |
Return the default folder where user-specific data is stored.
This depends of the system on which Python is running,
:return: path to the user-specific configuration data folder
def configuration_get_default_folder():
"""
Return the default folder where user-specific data is stored.
This depends of... |
Create a new Language instance from a locale string
:param locale: locale as string
:return: Language instance with instance.locale() == locale if locale is valid else instance of Unknown Language
def from_locale(cls, locale):
"""
Create a new Language instance from a locale string
... |
Create a new Language instance from a ISO639 string
:param xx: ISO639 as string
:return: Language instance with instance.xx() == xx if xx is valid else instance of UnknownLanguage
def from_xx(cls, xx):
"""
Create a new Language instance from a ISO639 string
:param xx: ISO639 as ... |
Create a new Language instance from a LanguageID string
:param xxx: LanguageID as string
:return: Language instance with instance.xxx() == xxx if xxx is valid else instance of UnknownLanguage
def from_xxx(cls, xxx):
"""
Create a new Language instance from a LanguageID string
:pa... |
Create a new Language instance from a name as string
:param name: name as string
:return: Language instance with instance.name() == name if name is valid else instance of UnknownLanguage
def from_name(cls, name):
"""
Create a new Language instance from a name as string
:param na... |
Private helper function to create new Language instance.
:param xyzkey: one of ('locale', 'ISO639', 'LanguageID', 'LanguageName')
:param xyzvalue: corresponding value of xyzkey
:return: Language instance
def _from_xyz(cls, xyzkey, xyzvalue):
"""
Private helper function to create... |
Try to create a Language instance having only some limited data about the Language.
If no corresponding Language is found, a NotALanguageException is thrown.
:param value: data known about the language as string
:param xx: True if the value may be a locale
:param xxx: True if the value m... |
Try do determine the language of a text file.
:param filepath: string file path
:param chunk_size: amount of bytes of file to read to determine language
:return: Language instance if detection succeeded, otherwise return UnknownLanguage
def from_file(cls, filepath, chunk_size=None):
"""... |
What to do when a Folder in the tree is clicked
def onFolderTreeClicked(self, proxyIndex):
"""What to do when a Folder in the tree is clicked"""
if not proxyIndex.isValid():
return
index = self.proxyFileModel.mapToSource(proxyIndex)
settings = QSettings()
folder_pat... |
Sends a message to the queue.
A worker will run the task's function when it receives the message.
:param args: Arguments that will be passed to task on execution.
:param kwargs: Keyword arguments that will be passed to task
on execution.
:param host: Send this task to specif... |
Return the dictionary to be sent to the queue.
def _get_description(self, args: Tuple, kwargs: Dict[str, Any]) -> Dict[str, Any]:
"""Return the dictionary to be sent to the queue."""
return {
'id': uuid1().hex,
'args': args,
'kwargs': kwargs,
'module': se... |
Called by workers to run the wrapped function.
You may call it yourself if you want to run the task in current process
without sending to the queue.
If task has a `retry` property it will be retried on failure.
If task has a `max_run_time` property the task will not be allowed to
... |
Module name of the wrapped function.
def _module_name(self) -> str:
"""Module name of the wrapped function."""
name = self.f.__module__
if name == '__main__':
return importer.main_module_name()
return name |
Install internationalization support for the clients using the specified locale.
If there is no support for the locale, the default locale will be used.
As last resort, a null translator will be installed.
:param lc: locale to install. If None, the system default locale will be used.
def i18n_install(lc=No... |
Return the system locale
:return: the system locale (as a string)
def i18n_system_locale():
"""
Return the system locale
:return: the system locale (as a string)
"""
log.debug('i18n_system_locale() called')
lc, encoding = locale.getlocale()
log.debug('locale.getlocale() = (lc="{lc}", en... |
Calculate all child locales from a locale.
e.g. for locale="pt_BR.us-ascii", returns ["pt_BR.us-ascii", "pt_BR.us", "pt_BR", "pt"]
:param lc: locale for which the child locales are needed
:return: all child locales (including the parameter lc)
def i18n_locale_fallbacks_calculate(lc):
"""
Calculate ... |
Find out whether lc is supported. Returns all child locales (and eventually lc) which do have support.
:param lc_parent: Locale for which we want to know the child locales that are supported
:return: list of supported locales
def i18n_support_locale(lc_parent):
"""
Find out whether lc is supported. Ret... |
Get path to the internationalization data.
:return: path as a string
def i18n_get_path():
"""
Get path to the internationalization data.
:return: path as a string
"""
local_locale_path = client_get_path() / 'locale'
if platform.system() == 'Linux':
if local_locale_path.exists():
... |
List all locales that have internationalization data for this program
:return: List of locales
def i18n_get_supported_locales():
"""
List all locales that have internationalization data for this program
:return: List of locales
"""
locale_path = i18n_get_path()
log.debug('Scanning translati... |
Load values from an object.
def from_object(self, obj: Union[str, Any]) -> None:
"""Load values from an object."""
if isinstance(obj, str):
obj = importer.import_object_str(obj)
for key in dir(obj):
if key.isupper():
value = getattr(obj, key)
... |
Load values from a dict.
def from_dict(self, d: Dict[str, Any]) -> None:
"""Load values from a dict."""
for key, value in d.items():
if key.isupper():
self._setattr(key, value)
logger.info("Config is loaded from dict: %r", d) |
Load values from a Python file.
def from_pyfile(self, filename: str) -> None:
"""Load values from a Python file."""
globals_ = {} # type: Dict[str, Any]
locals_ = {} # type: Dict[str, Any]
with open(filename, "rb") as f:
exec(compile(f.read(), filename, 'exec'), globals_, ... |
Load values from environment variables.
Keys must start with `KUYRUK_`.
def from_env_vars(self) -> None:
"""Load values from environment variables.
Keys must start with `KUYRUK_`."""
for key, value in os.environ.items():
if key.startswith('KUYRUK_'):
key = ke... |
Context manager for temporarily setting a keyword argument and
then restoring it to whatever it was before.
def option(current_kwargs, **kwargs):
"""
Context manager for temporarily setting a keyword argument and
then restoring it to whatever it was before.
"""
tmp_kwargs = dict((key, current_... |
Returns True if `node` is a method call for `method_name`. `method_name`
can be either a string or an iterable of strings.
def is_method_call(node, method_name):
"""
Returns True if `node` is a method call for `method_name`. `method_name`
can be either a string or an iterable of strings.
"""
i... |
Returns True is node is a loop helper e.g. {{ loop.index }} or {{ loop.first }}
def is_loop_helper(node):
"""
Returns True is node is a loop helper e.g. {{ loop.index }} or {{ loop.first }}
"""
return hasattr(node, 'node') and isinstance(node.node, nodes.Name) and node.node.name == 'loop' |
Returns the generated JavaScript code.
Returns:
str
def get_output(self):
"""
Returns the generated JavaScript code.
Returns:
str
"""
# generate the JS function string
template_function = TEMPLATE_WRAPPER.format(
function_nam... |
Returns the variable name assigned to the given dependency or None if the dependency has
not yet been registered.
Args:
dependency (str): Thet dependency that needs to be imported.
Returns:
str or None
def _get_depencency_var_name(self, dependency):
"""
... |
Adds the given dependency and returns the variable name to use to access it. If `var_name`
is not given then a random one will be created.
Args:
dependency (str):
var_name (str, optional):
Returns:
str
def _add_dependency(self, dependency, var_name=None):
... |
Processes an extends block e.g. `{% extends "some/template.jinja" %}`
def _process_extends(self, node, **kwargs):
"""
Processes an extends block e.g. `{% extends "some/template.jinja" %}`
"""
# find all the blocks in this template
for b in self.ast.find_all(nodes.Block):
... |
Processes a block e.g. `{% block my_block %}{% endblock %}`
def _process_block(self, node, **kwargs):
"""
Processes a block e.g. `{% block my_block %}{% endblock %}`
"""
# check if this node already has a 'super_block' attribute
if not hasattr(node, 'super_block'):
... |
Processes an output node, which will contain things like `Name` and `TemplateData` nodes.
def _process_output(self, node, **kwargs):
"""
Processes an output node, which will contain things like `Name` and `TemplateData` nodes.
"""
for n in node.nodes:
self._process_node(n, *... |
Processes a `TemplateData` node, this is just a bit of as-is text
to be written to the output.
def _process_templatedata(self, node, **_):
"""
Processes a `TemplateData` node, this is just a bit of as-is text
to be written to the output.
"""
# escape double quotes
... |
Processes a `Name` node. Some examples of `Name` nodes:
{{ foo }} -> 'foo' is a Name
{% if foo }} -> 'foo' is a Name
def _process_name(self, node, **kwargs):
"""
Processes a `Name` node. Some examples of `Name` nodes:
{{ foo }} -> 'foo' is a Name
{% if fo... |
Processes a `GetAttr` node. e.g. {{ foo.bar }}
def _process_getattr(self, node, **kwargs):
"""
Processes a `GetAttr` node. e.g. {{ foo.bar }}
"""
with self._interpolation():
with self._python_bool_wrapper(**kwargs) as new_kwargs:
if is_loop_helper(node):
... |
Processes a `GetItem` node e.g. {{ foo["bar"] }}
def _process_getitem(self, node, **kwargs):
"""
Processes a `GetItem` node e.g. {{ foo["bar"] }}
"""
with self._interpolation():
with self._python_bool_wrapper(**kwargs) as new_kwargs:
self._process_node(node.... |
Processes a for loop. e.g.
{% for number in numbers %}
{{ number }}
{% endfor %}
{% for key, value in somemap.items() %}
{{ key }} -> {{ value }}
{% %}
def _process_for(self, node, **kwargs):
"""
Processes a for loop. e.g.
... |
Processes an if block e.g. `{% if foo %} do something {% endif %}`
def _process_if(self, node, execute_end=None, **kwargs):
"""
Processes an if block e.g. `{% if foo %} do something {% endif %}`
"""
with self._execution():
self.output.write('if')
self.output.wri... |
Processes a math node e.g. `Div`, `Sub`, `Add`, `Mul` etc...
If `function` is provided the expression is wrapped in a call to that function.
def _process_math(self, node, math_operator=None, function=None, **kwargs):
"""
Processes a math node e.g. `Div`, `Sub`, `Add`, `Mul` etc...
If `f... |
Processes a loop helper e.g. {{ loop.first }} or {{ loop.index }}
def _process_loop_helper(self, node, **kwargs):
"""
Processes a loop helper e.g. {{ loop.first }} or {{ loop.index }}
"""
if node.attr == LOOP_HELPER_INDEX:
self.output.write('(arguments[1] + 1)')
eli... |
Context manager for executing some JavaScript inside a template.
def _execution(self):
"""
Context manager for executing some JavaScript inside a template.
"""
did_start_executing = False
if self.state == STATE_DEFAULT:
did_start_executing = True
self.s... |
Context manager for creating scoped variables defined by the nodes in `nodes_list`.
These variables will be added to the context, and when the context manager exits the
context object will be restored to it's previous state.
def _scoped_variables(self, nodes_list, **kwargs):
"""
Context... |
Download an url to a local file.
:param url: url of the file to download
:param local_path: path where the downloaded file should be saved
:param callback: instance of ProgressCallback
:return: True is succeeded
def download_raw(url, local_path, callback):
"""
Download an url to a local file.
... |
Return a callback function suitable for using reporthook argument of urllib(.request).urlretrieve
:return: function object
def get_report_hook(self):
"""
Return a callback function suitable for using reporthook argument of urllib(.request).urlretrieve
:return: function object
""... |
Instead of iterating element by element, get a number of elements at each iteration step.
:param data: data to iterate on
:param width: maximum number of elements to get in each iteration step
:return:
def window_iterator(data, width):
"""
Instead of iterating element by element, get a number of el... |
Set a range.
The range is passed unchanged to the rangeChanged member function.
:param minimum: minimum value of the range (None if no percentage is required)
:param maximum: maximum value of the range (None if no percentage is required)
def set_range(self, minimum, maximum):
"""
... |
Create a new child ProgressCallback.
Minimum and maximum values of the child are mapped to parent_min and parent_max of this parent ProgressCallback.
:param parent_min: minimum value of the child is mapped to parent_min of this parent ProgressCallback
:param parent_max: maximum value of the chil... |
Call this function to inform that an update is available.
This function does NOT call finish when value == maximum.
:param value: The current index/position of the action. (Should be, but must not be, in the range [min, max])
:param args: extra positional arguments to pass on
:param kwar... |
Call this function to inform that the operation is finished.
:param args: extra positional arguments to pass on
:param kwargs: extra keyword arguments to pass on
def finish(self, *args, **kwargs):
"""
Call this function to inform that the operation is finished.
:param args: extr... |
Inform the parent of progress.
:param value: The value of this subprogresscallback
:param args: Extra positional arguments
:param kwargs: Extra keyword arguments
def on_update(self, value, *args, **kwargs):
"""
Inform the parent of progress.
:param value: The value of th... |
Login to the Server using username/password,
empty parameters means an anonymously login
Returns True if login sucessful, and False if not.
def _login(self, username="", password=""):
"""Login to the Server using username/password,
empty parameters means an anonymously login
Ret... |
Logout from current session(token)
This functions doesn't return any boolean value, since it can 'fail' for anonymous logins
def _logout(self):
"""Logout from current session(token)
This functions doesn't return any boolean value, since it can 'fail' for anonymous logins
"""
sel... |
Parse the program arguments.
:return: argparse.Namespace object with the parsed arguments
def parse_arguments(args=None):
"""
Parse the program arguments.
:return: argparse.Namespace object with the parsed arguments
"""
parser = get_argument_parser()
# Autocomplete arguments
autocomple... |
Get a parser that is able to parse program arguments.
:return: instance of arparse.ArgumentParser
def get_argument_parser():
"""
Get a parser that is able to parse program arguments.
:return: instance of arparse.ArgumentParser
"""
parser = argparse.ArgumentParser(description=project.get_descrip... |
Wrap functions with this decorator to convert them to *tasks*.
After wrapping, calling the function will send a message to
a queue instead of running the function.
:param queue: Queue name for the tasks.
:param kwargs: Keyword arguments will be passed to
:class:`~kuyruk.Task... |
Returns a new channel from a new connection as a context manager.
def channel(self) -> Iterator[amqp.Channel]:
"""Returns a new channel from a new connection as a context manager."""
with self.connection() as conn:
ch = conn.channel()
logger.info('Opened new channel')
... |
Returns a new connection as a context manager.
def connection(self) -> Iterator[amqp.Connection]:
"""Returns a new connection as a context manager."""
TCP_USER_TIMEOUT = 18 # constant is available on Python 3.6+.
socket_settings = {TCP_USER_TIMEOUT: self.config.TCP_USER_TIMEOUT}
if sy... |
Scan the videopath string for video files.
:param videopath: Path object
:param callback: Instance of ProgressCallback
:param recursive: True if the scanning should happen recursive
:return: tuple with list of videos and list of subtitles (videos have matched subtitles)
def scan_videopath(videopath, ca... |
Scan a folder for videos and subtitles
:param folder_path: String of a directory
:param callback: Instance of ProgressCallback
:param recursive: True if the scanning should happen recursive
:return: tuple with list of videos and list of subtitles (videos have matched subtitles)
def __scan_folder(folder... |
Merge subtitles into videos.
:param path_subvideos: a dict with paths as key and a list of lists of videos and subtitles
:param callback: Instance of ProgressCallback
:return: tuple with list of videos and list of subtitles (videos have matched subtitles)
def merge_path_subvideo(path_subvideos, callback):
... |
Put the files in buckets according to extension_lists
files=[movie.avi, movie.srt], extension_lists=[[avi],[srt]] ==> [[movie.avi],[movie.srt]]
:param files: A list of files
:param extension_lists: A list of list of extensions
:return: The files filtered and sorted according to extension_lists
def filt... |
Detect the language of a subtitle filename
:param filename: filename of a subtitle
:return: Language object, None if language could not be detected.
def detect_language_filename(cls, filename):
"""
Detect the language of a subtitle filename
:param filename: filename of a subtitl... |
Detect whether the filename of videofile matches with this SubtitleFile.
:param video: VideoFile instance
:return: True if match
def matches_video_filename(self, video):
"""
Detect whether the filename of videofile matches with this SubtitleFile.
:param video: VideoFile instance... |
Install logger that will write to file. If this function has already installed a handler, replace it.
:param path: path to the log file, Use None for default file location.
def logging_file_install(path):
"""
Install logger that will write to file. If this function has already installed a handler, replace ... |
Install logger that will output to stderr. If this function ha already installed a handler, replace it.
:param loglevel: log level for the stream
def logging_stream_install(loglevel):
"""
Install logger that will output to stderr. If this function ha already installed a handler, replace it.
:param logl... |
Stanford CoreNLP uses the Java "writeDelimitedTo" function, which
writes the size (and offset) of the buffer before writing the object.
This function handles parsing this message starting from offset 0.
@returns how many bytes of @buf were consumed.
def parseFromDelimitedString(obj, buf, offset=0):
""... |
Stanford CoreNLP uses the Java "writeDelimitedTo" function, which
writes the size (and offset) of the buffer before writing the object.
This function handles parsing this message starting from offset 0.
@returns how many bytes of @buf were consumed.
def writeToDelimitedString(obj, stream=None):
"""
... |
Helper routine that converts a Sentence protobuf to a string from
its tokens.
def to_text(sentence):
"""
Helper routine that converts a Sentence protobuf to a string from
its tokens.
"""
text = ""
for i, tok in enumerate(sentence.token):
if i != 0:
text += tok.before
... |
Public method to show a message in the bottom part of the splashscreen.
@param message message to be shown (string or QString)
def showMessage(self, message, *args):
"""
Public method to show a message in the bottom part of the splashscreen.
@param message message to be shown (string ... |
Parse a video at filepath, using pymediainfo framework.
:param path: path of video to parse as string
def parse_path(path):
"""
Parse a video at filepath, using pymediainfo framework.
:param path: path of video to parse as string
"""
import pymediainfo
metadata ... |
Private function to read (if not read already) and store the metadata of the local VideoFile.
def _read_metadata(self):
"""
Private function to read (if not read already) and store the metadata of the local VideoFile.
"""
if self._is_metadata_init():
return
try:
... |
Get size of this VideoFile in bytes
:return: size as integer
def get_size(self):
"""
Get size of this VideoFile in bytes
:return: size as integer
"""
if self._size is None:
self._size = self._filepath.stat().st_size
return self._size |
Get the hash of this local videofile
:return: hash as string
def get_osdb_hash(self):
"""
Get the hash of this local videofile
:return: hash as string
"""
if self._osdb_hash is None:
self._osdb_hash = self._calculate_osdb_hash()
return self._osdb_hash |
Calculate OSDB (OpenSubtitleDataBase) hash of this VideoFile
:return: hash as string
def _calculate_osdb_hash(self):
"""
Calculate OSDB (OpenSubtitleDataBase) hash of this VideoFile
:return: hash as string
"""
log.debug('_calculate_OSDB_hash() of "{path}" ...'.format(pat... |
Import module by it's name from following places in order:
- main module
- current working directory
- Python path
def import_module(name: str) -> ModuleType:
"""Import module by it's name from following places in order:
- main module
- current working directory
- Python path
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.