|
wininfparser 1.0
module that can create, open, save, edit Windows INF files (Driver Files).
|
Can return values, keys, and section comments of INF files. More...
Public Member Functions | |
| def | __init__ (self, AutodetectSizes=False) |
| Default constructor. More... | |
| def | GetSize (self) |
| Returns section size. More... | |
| def | __iter__ (self) |
| Lets go through the section content! More... | |
| def | SetKeyAutoSize (self, bool fKeyAlignment=True, int keyWhitespaces=None, int valueWhitespaces=None, int commentWhitespaces=None) |
| automatic alignment of keys according to the maximum length and setting the indent after the key and before the value More... | |
| def | SetHeader (self, str h) |
| Sets the header for the section. More... | |
| def | SetIndents (self, int keyWhitespaces=None, int valueWhitespaces=None, int commentWhitespaces=None) |
| sets section indents: whitespaces after key, whitespaces before value and whitespaces before comment More... | |
| def | __next__ (self) |
| Lets go through the section content! returns k - key returns v - value returns c - comment. More... | |
| def | Next (self) |
| Returns next Section. More... | |
| def | SetNext (self, n) |
| Sets next Section. More... | |
| def | SetPrevious (self, p) |
| Sets previous Section. More... | |
| def | CheckSection (self) |
| Checks if a section can be added to an inf file. More... | |
| def | Previous (self) |
| Returns previous Section. More... | |
| def | SetType (self, t) |
| Sets sction type must be INFsection.comment or INFsection.single_line or INFsection.key_pair. More... | |
| def | GetType (self) |
| Returns Section type. More... | |
| def | SetIndent (self, int i) |
| Sets indent after section. More... | |
| def | GetIndent (self) |
| returns indent after section More... | |
| def | SetName (self, NewName) |
| Sets section name. More... | |
| def | SetNameComment (self, NewNameComment) |
| Sets comment to section name. More... | |
| def | GetName (self) |
| returns section name More... | |
| def | SetValid (self) |
| Sets section to valid state. More... | |
| def | IsValid (self) |
| Checks if section valid. More... | |
| def | AddEmptyStrings (self) |
| Function required for parser inserts empty laines. More... | |
| def | AddData (self, k, v=None, c=None, fraw=False) |
| Adds k,v,c paramentrs to the end of the section. More... | |
| def | AddComment (self, c=None, fraw=False) |
| Adds comment to the end of the section. More... | |
| def | AddDataP (self, int pos, k, v=None, c=None, fraw=False) |
| Adds k,v,c parameters to the selected position of the section. More... | |
| def | RemoveKey (self, k) |
| Removes first matched key of the section. More... | |
| def | RemoveValue (self, v) |
| Removes first matched value of the section. More... | |
| def | RemoveComment (self, c) |
| Removes first matched comment of the section. More... | |
| def | __getitem__ (self, k) |
| Returns key with selected k name. More... | |
| def | __setitem__ (self, k, v) |
| Sets key value pair. More... | |
| def | GetKeyIndex (self, k, p=0) |
| Searches key where (k in key) from position p. More... | |
| def | GetExactKeyIndex (self, k, p=0) |
| Looks for a key where k exactly matches the key from position p. More... | |
| def | SearchKeyIter (self, k, p=0) |
| Searches key where (k in key) from position p this function used to iterate over section and search. More... | |
| def | SearchValueIter (self, v, p=0) |
| Searches value where (v in value) from position p this function used to iterate over section and search. More... | |
| def | Find (self, str k, int p=0) |
| Searches key where (k in key) from position p and return its value. More... | |
| def | FindKey (self, k, p=0) |
| Searches key where (k in key) from position p. More... | |
| def | FindValueIndex (self, v, p=0) |
| Searches value where (v in value) from position p. More... | |
| def | FindValue (self, v, p=0) |
| Searches value where (v in value) from position p. More... | |
| def | GetValue (self, Index) |
| Returns value with selected index. More... | |
| def | Info (self) |
| Prints all section content. More... | |
| def | Save (self) |
| Saves all section content to the string. More... | |
Static Public Attributes | |
| int | comment = 1 |
| int | single_line = 2 |
| int | key_pair = 3 |
Can return values, keys, and section comments of INF files.
Allows you to navigate through the contents of a section. Able to add and remove values. Can search for keys and values within a section
| variable | description | Value |
|---|---|---|
| comment | typicali header section with comments ony content | 1 |
| single_line | section that contains only values | 2 |
| key_pair | section that contains key value pairs | 3 |
| def wininfparser.INFsection.__init__ | ( | self, | |
AutodetectSizes = False |
|||
| ) |
Default constructor.
| def wininfparser.INFsection.__getitem__ | ( | self, | |
| k | |||
| ) |
Returns key with selected k name.
| k | (str) |
| def wininfparser.INFsection.__iter__ | ( | self | ) |
Lets go through the section content!
| def wininfparser.INFsection.__next__ | ( | self | ) |
Lets go through the section content! returns k - key returns v - value returns c - comment.
| def wininfparser.INFsection.__setitem__ | ( | self, | |
| k, | |||
| v | |||
| ) |
Sets key value pair.
| k | (str) |
| v | (str) |
| def wininfparser.INFsection.AddComment | ( | self, | |
c = None, |
|||
fraw = False |
|||
| ) |
Adds comment to the end of the section.
| c | (str) |
| def wininfparser.INFsection.AddData | ( | self, | |
| k, | |||
v = None, |
|||
c = None, |
|||
fraw = False |
|||
| ) |
Adds k,v,c paramentrs to the end of the section.
| k | key (str) |
| v | value (str) |
| c | comment (str) |
| def wininfparser.INFsection.AddDataP | ( | self, | |
| int | pos, | ||
| k, | |||
v = None, |
|||
c = None, |
|||
fraw = False |
|||
| ) |
Adds k,v,c parameters to the selected position of the section.
| pos | position (int) |
| k | key (str) |
| v | value (str) |
| c | comment (str) |
| def wininfparser.INFsection.AddEmptyStrings | ( | self | ) |
Function required for parser inserts empty laines.
| def wininfparser.INFsection.CheckSection | ( | self | ) |
Checks if a section can be added to an inf file.
| def wininfparser.INFsection.Find | ( | self, | |
| str | k, | ||
| int | p = 0 |
||
| ) |
Searches key where (k in key) from position p and return its value.
| k | (str) |
| p | (int) |
| def wininfparser.INFsection.FindKey | ( | self, | |
| k, | |||
p = 0 |
|||
| ) |
Searches key where (k in key) from position p.
| k | (str) |
| p | (int) |
| def wininfparser.INFsection.FindValue | ( | self, | |
| v, | |||
p = 0 |
|||
| ) |
Searches value where (v in value) from position p.
| v | (str) |
| p | (int) |
| def wininfparser.INFsection.FindValueIndex | ( | self, | |
| v, | |||
p = 0 |
|||
| ) |
Searches value where (v in value) from position p.
| v | (str) |
| p | (int) |
| def wininfparser.INFsection.GetExactKeyIndex | ( | self, | |
| k, | |||
p = 0 |
|||
| ) |
Looks for a key where k exactly matches the key from position p.
| k | (str) |
| p | (int) |
| def wininfparser.INFsection.GetIndent | ( | self | ) |
returns indent after section
| def wininfparser.INFsection.GetKeyIndex | ( | self, | |
| k, | |||
p = 0 |
|||
| ) |
Searches key where (k in key) from position p.
| k | (str) |
| p | (int) |
| def wininfparser.INFsection.GetName | ( | self | ) |
returns section name
| NewName | (str) |
| def wininfparser.INFsection.GetSize | ( | self | ) |
Returns section size.
| def wininfparser.INFsection.GetType | ( | self | ) |
Returns Section type.
| def wininfparser.INFsection.GetValue | ( | self, | |
| Index | |||
| ) |
Returns value with selected index.
| Index | (int) |
| def wininfparser.INFsection.Info | ( | self | ) |
Prints all section content.
| def wininfparser.INFsection.IsValid | ( | self | ) |
Checks if section valid.
| def wininfparser.INFsection.Next | ( | self | ) |
Returns next Section.
| def wininfparser.INFsection.Previous | ( | self | ) |
Returns previous Section.
| def wininfparser.INFsection.RemoveComment | ( | self, | |
| c | |||
| ) |
Removes first matched comment of the section.
| c | comment (str) |
| def wininfparser.INFsection.RemoveKey | ( | self, | |
| k | |||
| ) |
Removes first matched key of the section.
| k | key (str) |
| def wininfparser.INFsection.RemoveValue | ( | self, | |
| v | |||
| ) |
Removes first matched value of the section.
| v | value (str) |
| def wininfparser.INFsection.Save | ( | self | ) |
Saves all section content to the string.
| def wininfparser.INFsection.SearchKeyIter | ( | self, | |
| k, | |||
p = 0 |
|||
| ) |
Searches key where (k in key) from position p this function used to iterate over section and search.
| k | (str) |
| p | (int) |
| def wininfparser.INFsection.SearchValueIter | ( | self, | |
| v, | |||
p = 0 |
|||
| ) |
Searches value where (v in value) from position p this function used to iterate over section and search.
| v | (str) |
| p | (int) |
| def wininfparser.INFsection.SetHeader | ( | self, | |
| str | h | ||
| ) |
Sets the header for the section.
| h | (str) |
| def wininfparser.INFsection.SetIndent | ( | self, | |
| int | i | ||
| ) |
Sets indent after section.
| i | (int) |
| def wininfparser.INFsection.SetIndents | ( | self, | |
| int | keyWhitespaces = None, |
||
| int | valueWhitespaces = None, |
||
| int | commentWhitespaces = None |
||
| ) |
sets section indents: whitespaces after key, whitespaces before value and whitespaces before comment
| keyWhitespaces | (int) number of whitespaces after key |
| valueWhitespaces | (int) number of whitespaces before value |
| commentWhitespaces | (int) number of whitespaces before comment |
| def wininfparser.INFsection.SetKeyAutoSize | ( | self, | |
| bool | fKeyAlignment = True, |
||
| int | keyWhitespaces = None, |
||
| int | valueWhitespaces = None, |
||
| int | commentWhitespaces = None |
||
| ) |
automatic alignment of keys according to the maximum length and setting the indent after the key and before the value
| keyWhitespaces | (int) number of whitespaces after key |
| valueWhitespaces | (int) number of whitespaces before value |
| commentWhitespaces | (int) number of whitespaces before comment |
| fKeyAlignment | (bool) |
| def wininfparser.INFsection.SetName | ( | self, | |
| NewName | |||
| ) |
Sets section name.
| NewName | (str) |
| def wininfparser.INFsection.SetNameComment | ( | self, | |
| NewNameComment | |||
| ) |
Sets comment to section name.
| NewNameComment | (str) |
| def wininfparser.INFsection.SetNext | ( | self, | |
| n | |||
| ) |
Sets next Section.
| n | (INFsection) must be Invalid |
| def wininfparser.INFsection.SetPrevious | ( | self, | |
| p | |||
| ) |
Sets previous Section.
| p | (INFsection) must be Invalid |
| def wininfparser.INFsection.SetType | ( | self, | |
| t | |||
| ) |
Sets sction type must be INFsection.comment or INFsection.single_line or INFsection.key_pair.
| def wininfparser.INFsection.SetValid | ( | self | ) |
Sets section to valid state.
|
static |
|
static |
|
static |