示例#1
0
文件: squaresr.py 项目: ebad84/pyabr
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtWebEngineWidgets import QWebEngineView

import os
import sys

from libabr import Res, Control, Files, System

res = Res()
control = Control()
files = Files()


class MainApp(QMainWindow):
    def Game(self):
        System('/usr/games/squares')  # Run CatBall Game

    def __init__(self, ports, *args, **kwargs):
        super(MainApp, self).__init__(*args, **kwargs)
        self.Backend = ports[0]
        self.Env = ports[1]
        self.Widget = ports[2]
        self.AppName = ports[3]
        self.External = ports[4]

        self.Widget.SetWindowTitle(res.get('@string/app_name'))
        self.Widget.SetWindowIcon(QIcon(res.get(res.etc(self.AppName,
                                                        "logo"))))
        self.Widget.Resize(self, self.Env.width(), self.Env.height())
示例#2
0
文件: squares.py 项目: ebad84/pyabr
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
示例#3
0
#  Official Website: 		http://pyabr.rf.gd
#  Programmer & Creator:    Mani Jamali <*****@*****.**>
#  Gap channel: 			@pyabr
#  Gap group:   			@pyabr_community
#  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')),
示例#4
0
#
#######################################################################################

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()
示例#5
0
#
#  Programmer & Creator:    Mani Jamali <*****@*****.**>
#  Telegram or Gap channel: @pyabr
#  Telegram or Gap group:   @pyabr_community
#  Git source:              github.com/manijamali2003/pyabr
#
#######################################################################################

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('.')