addonpyHelpers (version 1.0.0)
index
c:\users\ninad\pycharmprojects\plugable_arch\src\addonpyhelpers.py

 
Modules
       
json
os
sys

 
Classes
       
builtins.object
AddonHelper

 
class AddonHelper(builtins.object)
    Small utility class to read json and info files
 
  Static methods defined here:
add_to_module_search_dir(file_path)
add dirpath path of file given so that file can be loaded with importlib
:param file_path: file which is to be loaded with importlib
:return: absolute dirname of file if found, None otherwise
convert_string_to_boolean(val)
Convert given string to bool
:param val: string
:return: boolean
:rtype: bool
get_basename_and_ext(file_path)
split the filepath in file name and extension. dirpath is stripped
:param file_path: absolute file path
:return: list with basename of file and extension
is_compatible_for_current_platform(eligible_platforms)
check if current platform is one listed in supplied platforms
:param eligible_platforms: supplied platform list
:return: true or false
:rtype: bool
parse_info_file(filename)
parse .info file for addon
:param filename: absolute file path to read
:return: info file contents
:rtype: dict
parse_json(file_contents)
parse json string
:param file_contents: string with json data
:return: dict with parsed data
:rtype: dict
:raises: ValueError
read_file(file_name)
read file and return string
:param file_name: file to read with absolute path
:return: file contents as string
:rtype: str
walk_dir(directory, ext=None, recursive=False, skip_list=[])
walk directory path to look for file with specific extension while optionally ignoring specific files
:param directory: directory path to walk
:param ext: file extension to get (if no extension, then its returned)
:param recursive: only consider current directory, do not walk recursively
:param skip_list: skip files mentioned in this list
:return: list of file paths matching criteria

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Author
        Ninad Mhatre