Utilities¶
These utilities are provided to make working with certain types of data a bit easier.
DepotFile¶
Color¶
-
class
sc2reader.utils.
Color
(name=None, r=0, g=0, b=0, a=255)¶ Stores a color name and rgba representation of a color. Individual color components can be retrieved with the dot operator:
color = Color(r=255, g=0, b=0, a=75) tuple(color.r,color.g, color.b, color.a) == color.rgba
You can also create a color by name.
color = Color(‘Red’)Only standard Starcraft colors are supported. ValueErrors will be thrown on invalid names or hex values.
-
hex
¶ The hexadecimal representation of the color
-
rgba
¶ Returns a tuple containing the color’s (r,g,b,a)
-
Length¶
PersonDict¶
AttributeDict¶
get_files¶
-
sc2reader.utils.
get_files
(path, exclude=[], depth=-1, followlinks=False, extension=None, **extras)¶ Retrieves files from the given path with configurable behavior.
Parameters: - path – Path to search for files
- depth – Limits the depth of the search. -1 = Unlimited
- followLinks – Enables the search to follow links.
- exclude – Excludes subdirectories with names in this list.
- extension – Restricts results to files matching the given extension.”