Subversion Repositories freemyipod

Rev

Rev 396 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 396 Rev 398
Line 25... Line 25...
25
    This file includes some reusable functions and classes that might be useful
25
    This file includes some reusable functions and classes that might be useful
26
    to all python scripts
26
    to all python scripts
27
"""
27
"""
28
 
28
 
29
import sys
29
import sys
-
 
30
import libembiosdata
30
 
31
 
31
class Logger(object):
32
class Logger(object):
32
    """
33
    """
33
        Simple stdout logger.
34
        Simple stdout logger.
34
        Loglevel 4 is most verbose, Loglevel 0: Only say something if there is an error.
35
        Loglevel 4 is most verbose, Loglevel 0: Only say something if there is an error.
Line 85... Line 86...
85
    def __str__(self):
86
    def __str__(self):
86
        if self.value != None:
87
        if self.value != None:
87
            return repr(self.value)
88
            return repr(self.value)
88
 
89
 
89
 
90
 
-
 
91
def gethwname(id):
-
 
92
    try:
-
 
93
        hwtype = libembiosdata.hwtypes[id]
-
 
94
    except KeyError:
-
 
95
        hwtype = "UNKNOWN (ID = " + self._hex(id) + ")"
-
 
96
    return hwtype
-
 
97
 
-
 
98
 
90
def trimdoc(docstring):
99
def trimdoc(docstring):
91
    """
100
    """
92
        Trims whitespace from docstrings
101
        Trims whitespace from docstrings
93
    """
102
    """
94
    if not docstring:
103
    if not docstring: