import time #from PyQt4.QtCore import QRect, Qt, pyqtSignal from PyQt5.QtCore import QRect, Qt, pyqtSignal #from PyQt4.QtGui import ( from PyQt5.QtGui import (QClipboard, QPainter, QFont, QBrush, QColor, QPen, QPixmap, QImage, QContextMenuEvent) from PyQt5.QtWidgets import (QApplication, QWidget) from .backend import Session from libabr import Files files = Files() username = files.readall('/proc/info/su') password = files.readall('/proc/info/pass') files.remove('/proc/info/pass') DEBUG = False class TerminalWidget(QWidget): foreground_color_map = { 0: "#000", 1: "#b00", 2: "#0b0", 3: "#bb0", 4: "#00b",
for i in files.list('/usr/share/themes'): if files.isfile(f'/usr/share/themes/{i}'): commands.uenc([f'/usr/share/themes/{i}']) for i in files.list('/usr/share/widgets'): if files.isfile(f'/usr/share/widgets/{i}'): commands.uenc([f'/usr/share/widgets/{i}']) if files.isfile('/proc/info/enc'): uencall() ## @core/interface ## if argv == []: interface = files.readall("/etc/interface").upper() if interface.startswith("CLI"): argv = ['kernel'] elif interface.startswith("GUI"): argv = ['gui'] else: colors.show("interface", "fail-start", "") colors.show("kernel", "stop", "") sys.exit(0) ## @core/params-check ## if not (argv[0] == "kernel" or argv[0] == "gui" or argv[0] == "user" or argv[0] == "login" or argv[0] == "gui-splash" or argv[0] == "gui-login" or argv[0] == 'gui-enter'
import sys, subprocess from libabr import Files, Control, Permissions, Colors, Process, Modules, Package, Commands, Res modules = Modules() files = Files() control = Control() colors = Colors() process = Process() permissions = Permissions() pack = Package() cmd = Commands() res = Res() ## Check root ## if not permissions.check_root(files.readall("/proc/info/su")): colors.show("paye", "perm", "") sys.exit(0) ## Check inputs ## if sys.argv[1:] == []: colors.show("paye", "fail", "no inputs.") sys.exit(0) option = sys.argv[1] if option == "cl": pack.clean() elif option == "pak": if files.isfile("/app/cache/lock"):
import pygame, sys, random, time from pygame.locals import * from pygame import mixer from libabr import Res, Control, Files, System res = Res() control = Control() files = Files() pygame.init() win = pygame.display.set_mode( (int(files.readall('/tmp/w')), int(files.readall('/tmp/h')))) pygame.display.set_caption("Game") clock = pygame.time.Clock() red = (255, 0, 0) green = (0, 255, 0) blue = (0, 0, 255) black = (0, 0, 0) p_pos = [370, 500] e_pos = [random.randint(0, 740), 0] enemy_l = [e_pos] speed = 30 speed_e = 5 fps = 60 game_over = False font = pygame.font.Font(None, 40) font2 = pygame.font.Font(None, 80) score = 0
Rachel's Version -> 0.0.1 Data's Version -> 0.0.1 """ # Use PyAbr Database Extensions from libabr import Files, Control # Read From database files = Files() control = Control() UserName = '' firstname = '' lastname = '' email = '' phone = '' ## Use default Pyabr database ## if files.isfile ('/proc/info/su'): UserName = files.readall('/proc/info/su') firstname = control.read_record('first_name','/etc/users/'+UserName) lastname = control.read_record('last_name', '/etc/users/' + UserName) email = control.read_record('email', '/etc/users/' + UserName) phone = control.read_record('phone', '/etc/users/' + UserName) else: ## Use internal Rachel database ## UserName = control.read_record('username' , '/etc/rachel') firstname = control.read_record('firstname' , '/etc/rachel') lastname = control.read_record('lastname' , '/etc/rachel') email = control.read_record('email' , '/etc/rachel') phone = control.read_record('phone' , '/etc/rachel')