| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: David Sommerseth <davids@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Python 3 uses the Unicode type for strings but it did only support the
Bytes type. So the loading of XML-to-Python-dict-map would fail.
This patch preserves the Bytes type support while adding Unicode support,
which is what is done other places in the code as well.
Signed-off-by: David Sommerseth <davids@redhat.com>
|
|
|
|
| |
Signed-off-by: David Sommerseth <davids@redhat.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Valid flags are:
* LOGFL_NORMAL
Log all messages to the log context, and send log message to stderr
on errors
* LOGFL_NODUPS
Log only unique messages. Duplicated messages will be removed
* LOGFL_NOSTDERR
Don't write to stderr, even if errors occur
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
This function would often fail during the unit test. Most probably because the
complete error checking was a bit odd. Rewritten the error checks to be a bit
more sane.
Also improved error situations, where it will now throw an exception with an
error message instead of just returning False.
|
|
|
|
| |
This caused an exception on Python2.3
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This function shadows the dmidecode.type() function. This is
to clarify more what the function does and to unify the API against
the dmidecodeXML API.
|
|
|
|
|
|
|
| |
This is a more dynamic function than the static functions like
dmidecode.bios(). The equivalent will be dmidecode.QuerySection('bios')
This is to unify the dmidecode API and the dmidecodeXML API
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The shard library got renamed to dmidecodemodule.so, and this was not
clever. When you do 'import dmidecode' in Python, it will look for
files in this order:
dmidecode
dmidecode.so
dmidecodemodule.so
dmidecode.py
dmidecode.pyc
This is of course a problem when the wrapper introduced in commit
65c9384ec9b6e265aba11227ffa37ae7a6a787d1 is called dmidecode.py, and
Python attempts to load dmidecodemodule.so before dmidecode.py.
To solve this, dmidecodemodule.so is now renamed to dmidecodemod.so.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As we now include libxml2 and the required libxml2mod (which is used to wrap
xmlDoc and xmlNode data into Python objects), importing only dmidecode caused
a failure. If adding import libxml2 first, everything would work out fine.
To avoid this issue, due to backwards compatibility, a tiny dmidecode wrapper
is implemted as well. The dmidecode.so module is now renamed to dmidecodemodule.so,
and the wrapper is now called dmidecode.py.
To simplify things, the dmidecodeXML module introduced in commit b25b2ca548508cd2beb26f465b7bc5a296592461
is not merged into the new dmidecode.py
The constants mentioned are now called dmidecode.DMIXML_NODE and dmidecode.DMIXML_DOC
and to instantiate the dmidecodeXML class, dmidecode.dmidecodeXML() is used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To use this API, you need to import dmidecodeXML. This is a wrapper class for
the internal XML API which has been implemented. In addition, you might also
want to import libxml2 as well.
dmidecodeXML::QuerySection(<string>)
Valid section strings can be found in the pymap.xml file, in the <GroupMapping>
tag section.
dmidecodeXML::TypeId(<integer between 0-255>)
Valid values should match the DMI/SMBIOS specification.
dmidecodeXML::SetResultType(resultType)
Result type can be either dmidecodeXML.DMIXML_NODE or dmidecodeXML.DMIXML_DOC
----------------------------------------------------------
import libxml2
import dmidecodeXML
dmixml = dmidecodeXML.dmidecodeXML()
section_nodes = dmixml.QuerySection('processor')
dmixml.SetResultType(dmidecodeXML.DMIXML_DOC)
typeid_doc = dmixml.QueryTypeId(0x10)
dmixml.SetResultType(dmidecodeXML.DMIXML_NODE)
typeid_doc.saveFormatFileEnc("-", "UTF-8", 1)
----------------------------------------------------------
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Instead of building up an u8 array with 255 cells where we only use one
cell at the time now, just pass the type id value as an int the whole way
through.
|
|
|
|
|
|
|
| |
Removed the `dmi_table_string' function, and `const struct
string_keyword *string' from the `options' struct. Also modified
the function calls that are now free of this, namely, `legacy_decode'
and `smbios_decode'.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
names
Also changed dmiMAP_ParseMappingXML(...) to dmiMAP_ParseMappingXML_GroupName(...). In the
dmidecode_get(...) function. This is just a quick fix for making it compile. It's also
needed to implement usage of dmiMAP_ParseMappingXML_TypeID(...) as well.
|
| |
|
|
|
|
|
|
|
|
| |
Merged the two XML files into one, and amended relevant code. I still
want to modify the XML tag names, but not yet.
The calls to dmidecode.type() not function as expected, but the others
are broken - this is next.
|
| |
|
|
|
|
|
|
|
| |
Updated test unit to match.
Throw an exception instead of returning None/False in some
functions.
|
|
|
|
|
|
|
|
|
| |
Don't write to stdout unless in debug mode (with respect to writing
to memory devices.
Added the xml datafile to setup (distutils).
Updated test case (incorporating color and cleaning up tests).
|
|
|
|
|
|
|
|
|
|
|
| |
The version is of now, v3.10.6. The version major field has been
upped due to the newly added XML functionality.
The version has been reverted to GPLv2.
Some headers have been cleaned up, copyright notices added etc.
Credits given where due.
|
| |
|
| |
|
|
|
|
|
|
| |
The default file is now set to /usr/share/python-dmidecode/pythonmap.xml
(defined in config.h) and can be overridden with the dmidecode.pythonmap()
function in Python.
|
|
|
|
|
|
|
|
| |
When calling dmidecode_get_xml(...) several times could cause a crash
due to the opt.dmiversion_n pointer being freed by a mistake when the
generated dmixml_n got freed later on in the function.
Also fixed an assertion typo
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@180 abc39116-655e-4be6-ad55-d661dc543056
|
|
|
|
| |
git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@179 abc39116-655e-4be6-ad55-d661dc543056
|
|
|
|
|
|
|
|
|
| |
Added the second type of stuffed bios (upstream).
Integrated dmidecode the binary into the test case for a more objective result.
git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@163 abc39116-655e-4be6-ad55-d661dc543056
|
|
|
|
|
|
|
| |
memory file or device.
git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@155 abc39116-655e-4be6-ad55-d661dc543056
|
|
|
|
| |
git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@137 abc39116-655e-4be6-ad55-d661dc543056
|
|
|
|
|
|
|
| |
Updated test cases to test for this too.
git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@136 abc39116-655e-4be6-ad55-d661dc543056
|
|
|
|
|
|
|
|
|
| |
Bettered test cases.
Case 127 magically fixed.
git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@135 abc39116-655e-4be6-ad55-d661dc543056
|
|
|
|
|
|
|
|
|
|
|
|
| |
should be implemented to return this string, so further cleanup is still
required; as it stands, there is no access to this information anymore!
Updated test case.
Further general cleanup.
git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@133 abc39116-655e-4be6-ad55-d661dc543056
|
|
|
|
| |
git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@127 abc39116-655e-4be6-ad55-d661dc543056
|
|
|
|
| |
git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@125 abc39116-655e-4be6-ad55-d661dc543056
|