Belle II Software development
TagFolderRainbowTable Class Reference
Inheritance diagram for TagFolderRainbowTable:

Public Member Functions

None update_from_json (self, str path)
 
None to_json (self, str path)
 
None update_to_json (self, str path)
 

Detailed Description

 Because of issues of too long filenames if the number of revision
is growing, the simple recipe of creating folder names by concatenating
the names of the revisions does not work.
Therefore, we use a hashing algorithm. At the same time we want to be
able to look up the folder content easily, so we create a rainbow table,
that is a simple text file that contains hash <> revisions.

Definition at line 35 of file validationpath.py.

Member Function Documentation

◆ to_json()

None to_json (   self,
str  path 
)
 Write out this dictionary as a json file. 

Definition at line 51 of file validationpath.py.

51 def to_json(self, path: str) -> None:
52 """ Write out this dictionary as a json file. """
53 os.makedirs(os.path.dirname(path), exist_ok=True)
54 with open(path, "w") as outfile:
55 json.dump(self, outfile, indent=4, sort_keys=True)
56

◆ update_from_json()

None update_from_json (   self,
str  path 
)
 Read a json file which was produced by the ``to_json`` method and
update this dictionary. If the path does not exist, do nothing. 

Definition at line 44 of file validationpath.py.

44 def update_from_json(self, path: str) -> None:
45 """ Read a json file which was produced by the ``to_json`` method and
46 update this dictionary. If the path does not exist, do nothing. """
47 if os.path.exists(path):
48 with open(path) as infile:
49 self.update(json.load(infile))
50

◆ update_to_json()

None update_to_json (   self,
str  path 
)
 Read json file (if exists) for anything the dictionary
doesn't contain yet and write everything back. 

Definition at line 57 of file validationpath.py.

57 def update_to_json(self, path: str) -> None:
58 """ Read json file (if exists) for anything the dictionary
59 doesn't contain yet and write everything back. """
60 self.update_from_json(path)
61 self.to_json(path)
62
63
64# Note that it is enough to have one object, even in the (unexpected) case that
65# there is more than one output_base_dir (at the cost of having some unneeded
66# entries there, perhaps)

The documentation for this class was generated from the following file: