示例#1
0
#!/usr/bin/env /usr/bin/python3
from auto_everything.base import Python, Terminal
py = Python()
t = Terminal()


class Tools():
    def __clear(self):
        commands = """
sudo rm -fr king_chat.egg-info
sudo rm -fr dist
sudo rm -fr build
        """
        t.run(commands)

    def push(self, comment):
        self.__clear()

        t.run('git add .')
        t.run('git commit -m "{}"'.format(comment))
        t.run('git push origin')

    def pull(self):
        t.run("""
git fetch --all
git reset --hard origin/master
""")

    def service(self):
        from auto_everything.base import Super
        s = Super()
示例#2
0
import os
import time
import numpy as np
import cv2

from auto_everything.base import Terminal
t = Terminal(debug=True)


class CommonGUI():
    def __init__(self, project_name=""):
        try:
            import pyautogui as pyautogui
        except Exception:
            error = """
To use this module, you have to install pyautogui:
    sudo apt -y install python3-xlib
    sudo pip3 install pyautogui
    sudo apt -y install python3-tk python3-dev
    sudo apt -y install scrot
            """
            raise Exception(error)

        self.pyautogui = pyautogui
        self.pyautogui.FAILSAFE = False

        self._data_folder = project_name + "_data"
        self._init_data_structure()
        self._load_data()

        self._last_check = {