示例#1
0
    def __init__(self, mount_config, debug=False):
        self.debug = debug
        self._dbg = dbg(self)
        
        self._mount_config = mount_config
        self._cdb_cmds = {'lock':'C1', 'unlock':'C2', 'get_setting':'C3', 'disconnect':'C6'}
        self._settings = {'battery':'02', 'serial':'03', 'needs_repair':'06', 'None':'00'}
        self._battery_level = {'0':'Unknown' ,'1':'Critical' ,'2':'Low' ,'3':'Medium', '4':'High'}

        if sys.platform == 'win32':
            self._sg_raw = 'bin/sg_raw'
        else:
            self._sg_raw = 'sg_raw'
示例#2
0
    def __init__(self, module, mount_point, utype=''):
        self._utype = utype
        self._dbg = dbg(module)
        
        if self._utype == 'firmware':
            self._remote_fw_files = DIDJ_REMOTE_FW_FILES
            self._fw_dir = DIDJ_FW_DIR
            self._remote_fw_dir = os.path.join(mount_point, DIDJ_REMOTE_FW_DIR)
            self._fw_files = DIDJ_FW_FILES

        elif self._utype == 'bootloader':
            self._remote_fw_files = DIDJ_REMOTE_BL_FILES
            self._fw_dir = DIDJ_BL_DIR
            self._remote_fw_dir = os.path.join(mount_point, DIDJ_REMOTE_BL_DIR,)
            self._fw_files = DIDJ_BL_FILES
        else:
            self.error('No update type selected.')

        self._fw_file_counter = list(self._fw_files)
示例#3
0
    def __init__(self, module, mount_point, utype=''):
        self._utype = utype
        self._dbg = dbg(module)

        if self._utype == 'firmware':
            self._remote_fw_files = DIDJ_REMOTE_FW_FILES
            self._fw_dir = DIDJ_FW_DIR
            self._remote_fw_dir = os.path.join(mount_point, DIDJ_REMOTE_FW_DIR)
            self._fw_files = DIDJ_FW_FILES

        elif self._utype == 'bootloader':
            self._remote_fw_files = DIDJ_REMOTE_BL_FILES
            self._fw_dir = DIDJ_BL_DIR
            self._remote_fw_dir = os.path.join(
                mount_point,
                DIDJ_REMOTE_BL_DIR,
            )
            self._fw_files = DIDJ_BL_FILES
        else:
            self.error('No update type selected.')

        self._fw_file_counter = list(self._fw_files)
示例#4
0
 def __init__(self, debug):
     self.debug = debug
     self._dbg = dbg(self)
示例#5
0
 def __init__(self, debug):
     self.debug = debug
     self._dbg = dbg(self)