# Git source: github.com/PyFarsi/pyabr # ####################################################################################### from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtCore import * from libabr import Files, Control, Res files = Files() control = Control() res = Res() import random import time IMG_BOMB = QImage(res.get(res.etc("mines", 'bug'))) IMG_FLAG = QImage(res.get(res.etc("mines", 'flag'))) IMG_START = QImage(res.get(res.etc("mines", 'rocket'))) IMG_CLOCK = QImage(res.get(res.etc("mines", 'clock-select'))) NUM_COLORS = { 1: QColor(res.etc("mines", 'color1')), 2: QColor(res.etc("mines", 'color2')), 3: QColor(res.etc("mines", 'color3')), 4: QColor(res.etc("mines", 'color4')), 5: QColor(res.etc("mines", 'color5')), 6: QColor(res.etc("mines", 'color6')), 7: QColor(res.etc("mines", 'color7')), 8: QColor(res.etc("mines", 'color8')) }
import sys , os from PyQt5 import QtWidgets, QtGui, QtCore from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * from libabr import Files, Control, System, Res, Commands, Permissions res = Res() files = Files() control = Control() commands = Commands() permissions = Permissions() f = QtGui.QFont() f.setPointSize(int(res.etc("roller","fontsize"))) class FileListView (QtWidgets.QListView): AppName = "roller" def format(self, it, text): if files.isdir(self.dir + '/' + text): it.setIcon(QtGui.QIcon(res.get(res.etc("roller","folder-icon")))) else: format = it.whatsThis().split('.') format = max(format) if it.whatsThis().endswith(format): logo = control.read_record(format + '.icon', '/etc/ext') if not logo == None: it.setIcon(QtGui.QIcon(res.get(logo))) else: it.setIcon(QtGui.QIcon(res.get(res.etc("roller",'file-icon'))))