summaryrefslogtreecommitdiffstats
path: root/src/setup.py
Commit message (Collapse)AuthorAgeFilesLines
* Update Python build rulesDavid Sommerseth2010-01-081-0/+1
|
* Take endinanness into consideration when compilingDavid Sommerseth2009-12-141-1/+3
|
* Moved a OS-specific library settings out to commonv3.10.6-rc1Nima Talebi2009-08-031-3/+1
| | | | | The libxml2 path is now handled by `setup_common.py', so the actual setup files are clean from any OS-specific (Debian/RedHat) hacks.
* Undefine NDEBUG in normal compiles as well.David Sommerseth2009-07-011-1/+2
| | | | | | Arguments for doing so is that asserts are important to catch unhandled error situations and will help debugging if it fails in a production environment.
* Splitted out SMBIOS/DMI dump functions from dmidecode.c to separate filesDavid Sommerseth2009-06-181-1/+3
|
* Commented in the Debian workaround for `xml2mod'Nima Talebi2009-06-171-0/+1
|
* Improved setup.py/setup-dbg.py even moreDavid Sommerseth2009-06-111-5/+22
| | | | | Get libxml2 compile time info from xml2-config. Retrieve version number from src/version.h
* Made sure copyright is in place and right people get their deserved creditDavid Sommerseth2009-06-111-0/+28
|
* Cleaned up and fetch libdir from Python settings insteadDavid Sommerseth2009-06-101-2/+5
|
* Discovered another issue with Python and importsDavid Sommerseth2009-06-101-1/+1
| | | | | | | | | | | | | | | | | | 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.
* Fixed import issues with dmidecodeDavid Sommerseth2009-06-101-2/+3
| | | | | | | | | | | | | | | | 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.
* Implemented native libxml2 XML API for dmidecodeDavid Sommerseth2009-06-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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) ----------------------------------------------------------
* Remember to compile in dmierror.c ;-)David Sommerseth2009-06-091-0/+1
|
* Removed some dead codeDavid Sommerseth2009-06-031-1/+0
|
* WIP commitNima Talebi2009-05-271-1/+1
| | | | | | | | 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.
* Follow-up on recent XML config file renameNima Talebi2009-05-241-1/+1
|
* More cleanupNima Talebi2009-05-231-2/+2
| | | | | | | | | 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).
* Updating Debian-specificsNima Talebi2009-05-231-1/+2
|
* Final cleanupNima Talebi2009-05-231-1/+1
|
* Reversioned, relicensed, and rejiggedNima Talebi2009-05-221-1/+1
| | | | | | | | | | | 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.
* Bringing setup files upto dateNima Talebi2009-05-221-3/+3
|
* Version number fixNima Talebi2009-05-011-1/+1
|
* Added generic XML -> Python parserDavid Sommerseth2009-04-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The xmlpythonizer module will convert any XML data (xmlNode or xmlDoc) and format it as a Python object. The formatting is defined in it's own XML file. Basic format: <dmidecode_fieldmap version="1"> <Mapping name="{name of mapping table}"> <Map keytype="{key type}" key="{key value}" valuetype="{value type} value="{value}"/> </Mapping> </dmidecode_fieldmap> The keytype and key attributes defines the key in the Python Dict. The root element will always be a Python Dict structure. The valid key types are: * constant Uses the value in {key} as the key value * string, integer, float Uses a string value from the data XML to be converted to Python. The value set in the key attribute defines an XPath value which points to the data to be used as a Python dict key. Since Python only supports C strings in the C interface for Python dict keys, integer and float will be treated as strings. The valuetype and value attributes are similar to the keys, but with some more features. Valid valuetypes are: * constant The value given in the value attribute will be used in the value in the Python result. * string, integer, float The value given in the value attribute defines the XPath to the data XML, of where to retrieve the value for the given key. The valuetype defines if the data should be understood as a string, integer or float in the Python result. * list:string, list:integer, list:float This does the same as the string, integer or float type, with a tweak. The data will be put into a list. If the XPath given returns multiple nodes, all of them will be added to this list. * dict The dict valuetype is more special. It should not contain any value attribute. On the other hand, it should contain a sub-level of <Map> tags. In this way, you can build up a multi dimensional Python dict. Example: ** pythonmap.xml ** <?xml version="1.0" encoding="UTF-8"?> <dmidecode_fieldmap version="1"> <Mapping name="example_map"> <Map keytype="constant" key="DemoCase" valuetype="constant" value="XML Pythonizing"/> <Map keytype="constant" key="String1" valuetype="string" value="/example/string1"/> <Map keytype="constant" key="AttribString1" valuetype="integer" value="/example/string1/@int_value"/> <Map keytype="string" key="/example/keyset/@value" valuetype="dict"> <Map keytype="constant" key="Value1" valuetype="string" value="/example/keyset/value1"/> <Map keytype="constant" key="ValueList" valuetype="list:string" value="/example/keyset/valuelist"/> </Map> </Mapping> </dmidecode_fieldmap> ** exampledata.xml ** <?xml version="1.0" encoding="UTF-8"?> <example> <string1 int_value="1234">String value #1</string1> <keyset value="TestData"> <value1>More test data</value1> <valuelist>Value1 in list</valuelist> <valuelist>Value2 in list</valuelist> <valuelist>Value3 in list</valuelist> </keyset> </example> ** C code snippet ** void xmlpythonizer() { xmlDoc *xmlmap = NULL; xmlDoc *xmldata = NULL; ptzMAP *mapping = NULL; PyObject *pythondata = NULL; // Read XML files xmlmap = xmlReadFile("pythonmap.xml", NULL, 0); xmldata = xmlReadFile("exampledata.xml", NULL, 0); // Parse the mapping XML mapping = dmiMAP_ParseMappingXML(xmlmap, "example_map"); // Parse the xmldata into a Python object pythondata = pythonizeXMLdoc(mapping, xmldata); // ..... the program continues to do something useful } The result stored inside the pythondata object should now be something similar to: {'DemoCase': 'XML Pythonizing', 'String1': 'String value #1', 'AttribString1: 1234, 'TestData': {'Value1': 'More test data', 'ValueList': ['Value1 in list','Value2 in list','Value3 in list']} }
* Modified setup.py to compile in dmixml.c and link against libxml2David Sommerseth2009-04-291-2/+4
|
* Reverting recent (pointless) change.nima2009-03-311-0/+25
| | | | git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@180 abc39116-655e-4be6-ad55-d661dc543056
* Preparing to migrate to GIT.nima2009-03-311-25/+0
| | | | git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@179 abc39116-655e-4be6-ad55-d661dc543056
* Fixed bug reported by Ralf Treinen.nima2009-02-221-2/+2
| | | | git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@174 abc39116-655e-4be6-ad55-d661dc543056
* Upped sub-version.nima2009-02-131-1/+1
| | | | git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@172 abc39116-655e-4be6-ad55-d661dc543056
* Versioning now chagned to reflect the version of the upstream (dmidecode)nima2009-02-131-1/+1
| | | | | | | version with which python-dmidecode is in sync with. git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@170 abc39116-655e-4be6-ad55-d661dc543056
* Removed "detected" from appearing in every single function call. TODO: An ivarnima2008-12-201-1/+1
| | | | | | | | | | | | 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
* Oops - fixed.nima2008-12-191-1/+1
| | | | git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@131 abc39116-655e-4be6-ad55-d661dc543056
* More work on test case.nima2008-12-191-3/+3
| | | | | | | Updated setup.py to reflect new version. git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@128 abc39116-655e-4be6-ad55-d661dc543056
* Cleaning up source area, ready for debianizing, and rpm after that.nima2008-12-171-0/+25
git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@108 abc39116-655e-4be6-ad55-d661dc543056