adaptivemd.JSONFile

class adaptivemd.JSONFile(location)[source]

A special file which as assumed JSON readable content

__init__(location)[source]

Methods

__init__(location)
args() Return a list of args of the __init__ function of a class
base() Return the most parent class actually derived from StorableMixin
clone() create a cloned object with equal attributes
copy([target]) copy file to a target
create(scheduler) Mark file as being existent on a specific scheduler.
descendants() Return a list of all subclassed objects
from_dict(dct)
get([scheduler]) Read data from the JSON file at the files location without storing
get_file()
get_uuid() Create a new unique ID
idx(store) Return the index which is used for the object in the given store.
link([target]) link file to a target
load([scheduler])
modified() Mark a file as being altered and not existent anymore
move([target]) move file to a target
named(name) Attach a .name property to an object
objects() Returns a dictionary of all storable objects
remove() remove file
set_file(content) Set the file content.
to_dict()
touch() touch file
transfer([target]) transfer file to a target

Attributes

ACTIVE_LONG
CREATION_COUNT
INSTANCE_UUID
allowed_drives
base_cls Return the base class
base_cls_name Return the name of the base class
basename returns: the file basename
basename_short returns: the basename without extension
cls Return the class name as a string
created
data returns: the parsed JSON content
default_drive
dirname returns: the path of the directory, like os.path.dirname
drive return the prefix name
exists
extension returns: the filename extension or ‘’ of non exists
generator
has_file
is_folder returns: True if location is a folder
is_temp returns: True when the location is a temporary folder that might be
path returns: the complete path without prefix
short returns: a shortened form of the path
split returns:
split_drive returns: * str – the drive (prefix with ://)
task
url returns: return the full form always with a prefix
use_absolute_local_paths
data
Returns:the parsed JSON content
Return type:dict
get(scheduler=None)[source]

Read data from the JSON file at the files location without storing

Parameters:scheduler (Scheduler or None) – if given use the prefixing from the scheduler
Returns:the data in the file
Return type:dict