Beispiel #1
0
 def prepare(self):
     set_procname(PNAME_OLED)
     if self.detect():
         i2c = busio.I2C(D1, D0) # Create the I2C interface.
         # Create the SSD1306 OLED class.
         # The first two parameters are the pixel width and pixel height.
         self.m_oDisplay = SSD1306_I2C(128, 64, i2c, addr=0x3C)
         # Create blank image for drawing.
         # Make sure to create image with mode '1' for 1-bit color.
         self.m_iDspWidth = self.m_oDisplay.width
         self.m_iDspHeight = self.m_oDisplay.height
         self.m_oOutput = Image.new("1", (self.m_iDspWidth, self.m_iDspHeight), color=0)
         self.m_oDraw = ImageDraw.Draw(self.m_oOutput)
         self.get_config()
         self.get_assets()
         self.clear_screen()
     else:
         logging.info("Exiting piCRT display module")
         sys.exit()
sys.path.append(MODULES_PATH)

from launcher_module.core_paths import *
from launcher_module.utils import check_process, wait_process, set_procname

LOG_PATH = os.path.join(TMP_LAUNCHER_PATH, "CRT_External_Storage.log")
EXCEPTION_LOG = os.path.join(TMP_LAUNCHER_PATH, "backtrace.log")

CRT_OPT_FOLDER = "1CRT"
RETROPIE_OPT_FOLDER = "retropie"

__VERSION__ = '0.1'
__DEBUG__ = logging.INFO  # logging.ERROR
CLEAN_LOG_ONSTART = False

set_procname(PNAME_EXTSTRG)


class USBAutoService(object):
    m_lProcesses = []
    m_bPRestart = False

    m_lMountUSBsPrev = []  # Previous scan: disk ID + mnt Path
    m_lMountPathsPrev = []  # Previous scan: only mnt Path
    m_lMountUSBs = []  # Current scan: disk ID + mnt Path
    m_lMountPaths = []  # Current scan: disk ID + mnt Path
    m_lMountCtrl = []  # For control the valid usb path
    m_bChanges = False
    m_bUSBMounted = False  # To avoid to mount a second device

    m_dWrongFolderName = {
Beispiel #3
0
from launcher_module.core_paths import *
from launcher_module.utils import set_procname, check_process, \
                                  wait_process, module_exists, \
                                  module_loaded
from launcher_module.file_helpers import md5_file, ini_set, ini_get, \
                                         generate_random_temp_filename
from module_config.config_utils import saveboot

LOG_PATH = os.path.join(TMP_LAUNCHER_PATH, "CRT_RGB_Cable.log")
EXCEPTION_LOG = os.path.join(TMP_LAUNCHER_PATH, "backtrace.log")

__VERSION__ = '0.1'
__DEBUG__ = logging.INFO  # logging.ERROR
CLEAN_LOG_ONSTART = True

set_procname(PNAME_RGBCABLE)


class CRTDaemon(object):
    m_sHashConfig = ""
    m_iCableType = None
    m_iCableType_Prev = -1
    m_bCableLoaded = False
    m_bRecovery = False
    m_bRecovMode = "DEFAULT"
    m_bDaemonEna = True

    m_sTempFile = ""

    def __init__(self):
        self.__temp()
sys.path.append(MODULES_PATH)

from launcher_module.core_paths import *
from launcher_module.utils import set_procname
from launcher_module.file_helpers import remove_file, touch_file, add_line
from config_render import render

LOG_PATH = os.path.join(TMP_LAUNCHER_PATH, "CRT_Configuration_Utility.log")
EXCEPTION_LOG = os.path.join(TMP_LAUNCHER_PATH, "backtrace.log")

__VERSION__ = '0.1'
__DEBUG__ = logging.INFO  # logging.ERROR
CLEAN_LOG_ONSTART = True

os.system("clear")
set_procname(PNAME_CONFIG)

ES_LAUNCHER_DST_FILE = os.path.join(
    RETROPIE_PATH, "supplementary/emulationstation/emulationstation.sh")
ES_LAUNCHER_SRC_FILE = os.path.join(CRT_ES_RES_PATH,
                                    "configs/default_emulationstation.sh")
ES_LAUNCHER_BCK_FILE = os.path.join(
    RETROPIE_PATH, "supplementary/emulationstation/backup.emulationstation.sh")


class config(render):
    def __init__(self):
        self.__temp()
        self.__clean()
        super(render, self).__init__()
You should have received a copy of the GNU Lesser General Public License along
with this program.  If not, see <http://www.gnu.org/licenses/>.

"""

import os, sys, traceback
from launcher_module.core_paths import TMP_LAUNCHER_PATH, PNAME_LAUNCHER
from launcher_module.utils import something_is_bad, plugin_list, plugin_load, \
                                  show_info, set_procname

BASE_DIR = os.path.dirname(os.path.abspath(__file__))
MODULES_PATH = os.path.join(BASE_DIR, "launcher_module/plugins")

EXCEPTION_LOG = os.path.join(TMP_LAUNCHER_PATH, "backtrace.log")

set_procname(PNAME_LAUNCHER)

if __name__ == '__main__':
    try:
        sSystem = sys.argv[2]
        bSystemFound = False
        for pl in plugin_list(MODULES_PATH):
            # print("Loading plugin " + pl["name"])
            launcher = plugin_load(pl)
            if sSystem in launcher.get_system_list():
                bSystemFound = True
                launcher(sys.argv[1], sys.argv[2], sys.argv[3])
        if not bSystemFound:
            #something_is_bad("ERROR - System not supported!", sSystem)
            show_info("SYSTEM [%s] NOT SUPPORTED!" % sSystem, "", 7000)
    # TODO: kill emulator ?