Subversion Repositories freemyipod

Rev

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

Rev 424 Rev 427
Line 2... Line 2...
2
#
2
#
3
#
3
#
4
#    Copyright 2010 TheSeven, benedikt93, Farthen
4
#    Copyright 2010 TheSeven, benedikt93, Farthen
5
#
5
#
6
#
6
#
7
#    This file is part of emBIOS.
7
#    This file is part of emCORE.
8
#
8
#
9
#    emBIOS is free software: you can redistribute it and/or
9
#    emCORE is free software: you can redistribute it and/or
10
#    modify it under the terms of the GNU General Public License as
10
#    modify it under the terms of the GNU General Public License as
11
#    published by the Free Software Foundation, either version 2 of the
11
#    published by the Free Software Foundation, either version 2 of the
12
#    License, or (at your option) any later version.
12
#    License, or (at your option) any later version.
13
#
13
#
14
#    emBIOS is distributed in the hope that it will be useful,
14
#    emCORE is distributed in the hope that it will be useful,
15
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
16
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
#    See the GNU General Public License for more details.
17
#    See the GNU General Public License for more details.
18
#
18
#
19
#    You should have received a copy of the GNU General Public License
19
#    You should have received a copy of the GNU General Public License
20
#    along with emBIOS.  If not, see <http://www.gnu.org/licenses/>.
20
#    along with emCORE.  If not, see <http://www.gnu.org/licenses/>.
21
#
21
#
22
#
22
#
23
 
23
 
24
"""
24
"""
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
import libemcoredata
31
 
31
 
32
class Logger(object):
32
class Logger(object):
33
    """
33
    """
34
        Simple stdout logger.
34
        Simple stdout logger.
35
        Loglevel 3 is most verbose, Loglevel 0: Only log something if there is an error.
35
        Loglevel 3 is most verbose, Loglevel 0: Only log something if there is an error.
Line 103... Line 103...
103
            return repr(self.value)
103
            return repr(self.value)
104
 
104
 
105
 
105
 
106
def gethwname(id):
106
def gethwname(id):
107
    try:
107
    try:
108
        hwtype = libembiosdata.hwtypes[id]
108
        hwtype = libemcoredata.hwtypes[id]
109
    except KeyError:
109
    except KeyError:
110
        hwtype = "UNKNOWN (ID = " + self._hex(id) + ")"
110
        hwtype = "UNKNOWN (ID = " + self._hex(id) + ")"
111
    return hwtype
111
    return hwtype
112
 
112
 
113
 
113