INNER CODE UNIT · Python
PythonLiteralOption
BortonWrightonLabs/DRAM · bin/adjectives.py:17
class PythonLiteralOption(click.Option):
def type_cast_value(self, ctx, value):
try:
return ast.literal_eval(value)
except Exception as e:
logger.error(e)
raise click.BadParameter(value)
def get_assets_path(local_path):
"""
Locate the package data or non python files
:param local_path:
:returns:
"""
abs_snake_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "assets", local_path