Resolutions (Python)¶
ResolutionTable(file) Build a table of ResolutionEntry objects based on a show resolution file.
-
class
ResolutionTable.
ResolutionTable
¶ Bases:
object
Table of ResolutionEntry objects
-
__init__
¶ x.__init__(...) initializes x; see help(type(x)) for signature
-
__new__
(S, ...) → a new object with type S, a subtype of T¶
-
addEntries
(entries) → number of entries¶ Add the given entries to the resolution table. Return the total number of all entries.
-
clear
()¶ Remove all entries from the resolution table
-
createResolution
(width, height, name, groupName='', pixelAspect=1.0) → ResolutionTableEntry¶ Creates a new resolution with the given width, height and name. The name must not be already in use. Arguments:
- width The resolution in the x axis.
- height The resolution in the y axis.
- name A unique string identifier for the resolution.
- groupName A namespace for the resolution.
- pixelAspect The ratio of width to height for non square pixels.
Returns: A new ResolutionTableEntry.
Use addEntries to add the resulting resolution to this table.
-
extractValidResolutionName
(text) → string¶ Return the first resolution name in text.
-
findResolution
(width=-1, height=-1, aspect=-1.0) → ResolutionTableEntry¶ Find the entry for a given resolution name, or error.
-
findResolutionByName
(name) → ResolutionTableEntry or None¶ This function will search for a resolution with the given name and return a copy of the first resolution that matches or None if nothing was found. Arguments:
- name A string which needs to match to the name of a resolution in this resolution table.
Returns: A new ResolutionTableEntry, or None if nothing was found.
-
getEntries
() → list of entries¶ Return list of all entries.
-
getEntriesForGroup
(name) → list of entries¶ Return list of entries found in the resolution group.
-
getFilename
() → string¶ Get the filename this table was loaded from.
-
getGroups
() → list of strings¶ Return the first resolution name in text.
-
getResolution
(name) → ResolutionTableEntry¶ Get the entry for a given resolution name.
-
hasResolution
(name) → bool¶ Test if the table can make an entry for the name.
-
makeResolution
()¶ Deprecated Use createResolution and findResolutionByName
makeResolution(width=-1, height=-1, aspect=-1.0, name=””, fullName=”Miscellaneous”, proxyName=””, groupName=”misc”) -> ResolutionTableEntry
Find the entry for a given resolution name, or create a new entry.
-
-
class
ResolutionTable.
ResolutionTableEntry
¶ Bases:
object
Fields for an entry in ResolutionTable. Can only be created by ResolutionTable.
-
__init__
¶ x.__init__(...) initializes x; see help(type(x)) for signature
-
__new__
(S, ...) → a new object with type S, a subtype of T¶
-
__str__
¶
-
aspectRatio
() → float¶
-
fullname
() → string¶
-
groupname
() → string¶
-
name
() → string¶
-
proxyname
() → string¶
-
xres
() → int¶
-
yres
() → int¶
-