Exemple #1
0
def about():
    top = Toplevel(bg='#081421')
    img = ImageTk.PhotoImage(Image.open(config.resource_path("img/mark.png")))
    img_panel = Label(top, image=img, bg='#081421')
    img_panel.pack(pady=10)
    description = Label(
        top,
        text=
        "Made to have an easy way to track\n coronavirus cases in your area",
        fg="white",
        bg="#081421")
    description.pack(expand="no")
    size = 15, 15
    # Website Social
    adress = Label(top,
                   text="You can find me at https://maurom.dev/",
                   fg="white",
                   bg="#081421")
    adress.pack()
    # Github Social
    github = ImageTk.PhotoImage(
        Image.open(config.resource_path("img/github.png")).resize(size))
    g_icon = Label(top, image=github, bg="#081421")
    at = Label(top, text="@MM-coder", fg="white", bg="#081421")
    g_icon.pack(side=LEFT, padx=10)
    at.pack(side=LEFT)
    top.title("About")
    top.geometry("320x200")
    top.mainloop()
Exemple #2
0
 def __init__(self):
     super(Player, self).__init__()
     self.imagesattack = [
         resource_path("images/Player-1-Attack-" + str(i) + ".png")
         for i in range(1, 6)
     ]
     self.imageswalk = [
         resource_path("images/Player-1-Walk-" + str(i) + ".png")
         for i in range(1, 5)
     ]
     self.imagesstop = [
         resource_path("images/Player-1-Stop-" + str(i) + ".png")
         for i in range(1, 5)
     ]
     self.imageshit = [
         resource_path("images/Player-1-Hit-" + str(i) + ".png")
         for i in range(1, 5)
     ]
     self.imagesatirar = [
         resource_path("images/Player-1-Atirar-" + str(i) + ".png")
         for i in range(1, 6)
     ]
     self.images_list = self.imagesstop
     self.image = load(self.images_list[0])
     self.rect = self.image.get_rect()
     self.rect.y = SCREEN_HEIGHT * (0.65)
     self.rect.x = SCREEN_WIDTH / 2
     self.step = 10
     self.move_list = []
     self.sprint = 2
     self.counter = 0
     self.reverse = False
     self.pedras = 10
     self.life = 20
     self.execute = self.action_parado
Exemple #3
0
 def __init__(self, speed):
     super(Steam, self).__init__(speed)
     self.tipo = 2
     self.imageswalk = [
         resource_path("images/Enemy-" + str(self.tipo) + "-Walk-" + str(i) + ".png")
         for i in range(1, 7)
     ]
     self.imagesattack = [
         resource_path(
             "images/Enemy-" + str(self.tipo) + "-Attack-" + str(i) + ".png"
         )
         for i in range(1, 7)
     ]
     self.imagesstop = [
         resource_path("images/Enemy-" + str(self.tipo) + "-Walk-" + str(i) + ".png")
         for i in [
             1,
         ]
     ]
     self.imageshit = [
         resource_path("images/Enemy-" + str(self.tipo) + "-Hit-" + str(i) + ".png")
         for i in range(1, 4)
     ]
     self.imagesatirar = [
         resource_path(
             "images/Enemy-" + str(self.tipo) + "-Attack-" + str(i) + ".png"
         )
         for i in range(1, 7)
     ]
Exemple #4
0
    def __init__(self):
        creds = None
        # The file token.pickle stores the user's access and refresh tokens, and is
        # created automatically when the authorization flow completes for the first
        # time.
        if os.path.exists(f'{LOCAL_STORAGE_PATH}/google-auth-token.pickle'):
            with open(f'{LOCAL_STORAGE_PATH}/google-auth-token.pickle',
                      'rb') as token:
                creds = pickle.load(token)

        # If there are no (valid) credentials available, let the user log in.
        if not creds or not creds.valid:
            if creds and creds.expired and creds.refresh_token:
                creds.refresh(Request())
            else:
                flow = InstalledAppFlow.from_client_secrets_file(
                    resource_path(CREDENTIALS_PATH), GOOGLE_SCOPES)
                creds = flow.run_local_server(port=0)

            # Save the credentials for the next run
            with open(f'{LOCAL_STORAGE_PATH}/google-auth-token.pickle',
                      'wb') as token:
                pickle.dump(creds, token)

        self._service = build('calendar', 'v3', credentials=creds)
Exemple #5
0
def showAboutBox(parent, event=None):
    # __main__.app.PySpy.ToggleWindowStyle(wx.STAY_ON_TOP)

    description = """
    PySpy is an EVE Online character intel tool
    using CCP's ESI API and a daily updated proprietary
    database containing key statistics on approximately
    2.4 million pilots.

    If you enjoy PySpy and want to show your appreciation
    to its author, you are welcome to send an ISK donation
    in-game to White Russsian (with 3 "s").

    Thank you."""

    try:
        with open(config.resource_path('LICENSE.txt'), 'r') as lic_file:
            license = lic_file.read()
    except:
        license = "PySpy is licensed under the MIT License."

    info = wx.adv.AboutDialogInfo()

    info.SetIcon(wx.Icon(config.ABOUT_ICON, wx.BITMAP_TYPE_PNG))
    info.SetName("PySpy")
    info.SetVersion(config.CURRENT_VER)
    info.SetDescription(description)
    info.SetCopyright('(C) 2018 White Russsian')
    info.SetWebSite('https://github.com/Eve-PySpy/PySpy')
    info.SetLicence(license)

    wx.adv.AboutBox(info)
Exemple #6
0
def OnAboutBox(e):
    # __main__.app.PySpy.ToggleWindowStyle(wx.STAY_ON_TOP)

    description = """
    PySpy is a a simple EVE Online character intel tool
    using CCP's ESI API.

    If you enjoy PySpy and want to show your appreciation
    to its author, you are welcome to send an ISK donation
    in-game to White Russsian (with 3 "s").

    Thank you."""

    try:
        with open(config.resource_path('LICENSE.txt'), 'r') as lic_file:
            license = lic_file.read()
    except:
        license = "PySpy is licensed under the MIT License."

    info = wx.adv.AboutDialogInfo()

    info.SetIcon(wx.Icon(config.ABOUT_ICON, wx.BITMAP_TYPE_PNG))
    info.SetName('PySpy')
    info.SetVersion(config.CURRENT_VER)
    info.SetDescription(description)
    info.SetCopyright('(C) 2018 White Russsian')
    info.SetWebSite('https://github.com/WhiteRusssian/PySpy')
    info.SetLicence(license)

    wx.adv.AboutBox(info)
Exemple #7
0
def generate_wallpaper_and_set():
    image = Image.open(config.resource_path('img/base.png'))
    small = ImageFont.truetype('arial.ttf', 72)
    large = ImageFont.truetype('arial.ttf', 90)
    draw = ImageDraw.Draw(image)
    if config.load_option_from_config('country') != "World":
        draw.text(xy=(815, 359),
                  text=str(
                      api.get_country_stats(
                          api.get_country_id(
                              config.load_option_from_config('country')))[0]),
                  fill=(255, 255, 255),
                  font=large)
        draw.text(xy=(490, 680),
                  text=str(
                      api.get_country_stats(
                          api.get_country_id(
                              config.load_option_from_config('country')))[1]),
                  fill=(255, 255, 255),
                  font=small)
        draw.text(xy=(1265, 680),
                  text=str(
                      api.get_country_stats(
                          api.get_country_id(
                              config.load_option_from_config('country')))[2]),
                  fill=(255, 255, 255),
                  font=small)
    else:
        draw.text(xy=(815, 359),
                  text=str(api.get_world_cases()[0]),
                  fill=(255, 255, 255),
                  font=large)
        draw.text(xy=(490, 680),
                  text=str(api.get_world_cases()[1]),
                  fill=(255, 255, 255),
                  font=small)
        draw.text(xy=(1265, 680),
                  text=str(api.get_world_cases()[2]),
                  fill=(255, 255, 255),
                  font=small)
        draw.text(xy=(877, 680),
                  text=strftime("%d-%m\n%H:%M", gmtime()),
                  fill=(255, 255, 255),
                  font=small)
    image.save(config.resource_path('wallpaper.png'))
    set_wallpaper_from_file('wallpaper.png')
Exemple #8
0
 def __init__(self):
     self.backgroundwidth = SCREEN_WIDTH * 3
     self.background = pygame.image.load(resource_path("images/bg.png"))
     self.background = pygame.transform.scale(
         self.background, (self.backgroundwidth, SCREEN_HEIGHT))
     self.rect = self.background.get_rect()
     self.step = 0
     self.distance = 0
     self.walk1 = 0
     self.walk2 = self.backgroundwidth
Exemple #9
0
    def __init__(self, options):
        QMainWindow.__init__(self)

        self.ui = MainGui(self.get_server(), options)
        self.setCentralWidget(self.ui)

        self.statusBar()
        if self.ui.isServerRunning():
            self.statusBar().showMessage('Server started on port '+ str(AppConfig.Instance().getProxyConfig().port))
        menubar = self.menuBar()
        file_menu = menubar.addMenu('&File')
        file_menu.addAction(QtWidgets.QAction("Settings", self))

        toolbar = self.addToolBar('toolbar')
        self.server_control_action = QtWidgets.QAction(self.get_server_status_icon(), "Start/Stop Capture", self)
        self.server_control_action.triggered.connect(self.toggle_server)
        clear_action = QtWidgets.QAction(QtGui.QIcon(resource_path('assets/clear-icon.png')), "Clear", self)
        clear_action.triggered.connect(self.ui.clear_view)
        settings_action = QtWidgets.QAction(QtGui.QIcon(resource_path('assets/gear-icon.png')), "Settings", self)
        settings_action.triggered.connect(self.show_settings)
        search_field = QtWidgets.QLineEdit();
        search_field.textChanged.connect(self.ui.search_changed)
        add_cert = QtWidgets.QAction(QtGui.QIcon(resource_path('assets/cert-icon.png')), "Install certificate (opens 'mitmcert.it')", self)
        add_cert.triggered.connect(self.open_browser_to_cert)
        import_action = QtWidgets.QAction(QtGui.QIcon(resource_path('assets/import-icon.png')), "Import state from file", self)
        import_action.triggered.connect(lambda :self.show_import_export(False))
        export_action = QtWidgets.QAction(QtGui.QIcon(resource_path('assets/export-icon.png')), "Export state to file", self)
        export_action.triggered.connect(lambda :self.show_import_export(True))
        toolbar.addAction(clear_action)
        toolbar.addAction(self.server_control_action)
        toolbar.addAction(settings_action)
        toolbar.addSeparator()
        toolbar.addWidget(QtWidgets.QLabel("Filter:"))
        toolbar.addWidget(search_field)
        toolbar.addSeparator()
        toolbar.addAction(import_action)
        toolbar.addAction(export_action)
        toolbar.addAction(add_cert)
        toolbar.setMovable(False)
        self.setStyleSheet(appStyle)

        self.show()
Exemple #10
0
 def __init__(self):
     super(SpritePerson, self).__init__()
     self.pedra = PedraPlayer
     self.imagesattack = [
         resource_path("images/Player-1-Attack-" + str(i) + ".png")
         for i in range(1, 6)
     ]
     self.imageswalk = [
         resource_path("images/Player-1-Walk-" + str(i) + ".png")
         for i in range(1, 5)
     ]
     self.imagesstop = [
         resource_path("images/Player-1-Stop-" + str(i) + ".png")
         for i in range(1, 5)
     ]
     self.imageshit = [
         resource_path("images/Player-1-Hit-" + str(i) + ".png") for i in range(1, 5)
     ]
     self.imagesatirar = [
         resource_path("images/Player-1-Atirar-" + str(i) + ".png")
         for i in range(1, 5)
     ]
     self.images_list = self.imagesstop
     self.image_raw = load(self.images_list[0])
     self.rect_raw = self.image_raw.get_rect()
     self.image = pygame.transform.scale(
         self.image_raw, (int(self.rect_raw.width * RESIZE_FACTOR), int(self.rect_raw.height * RESIZE_FACTOR))
     )
     self.rect = self.image.get_rect()
     self.rect.y = SCREEN_HEIGHT * (0.65)
     self.rect.x = SCREEN_WIDTH / 2
     self.step = 10
     self.move_list = []
     self.sprint = 3
     self.counter = 0
     self.reverse = False
     self.pedras = 10
     self.life = 20
     self.damage_attack_1 = 2
     self.execute = self.action_parado
     self.in_kill = False
Exemple #11
0
 def __init__(self, speed):
     super(Enemy, self).__init__()
     self.tipo = 1
     self.imageswalk = [
         resource_path("images/Enemy-" + str(self.tipo) + "-Walk-" + str(i) + ".png")
         for i in range(1, 6)
     ]
     self.imagesattack = [
         resource_path(
             "images/Enemy-" + str(self.tipo) + "-Attack-" + str(i) + ".png"
         )
         for i in range(1, 7)
     ]
     self.imagesstop = [
         resource_path("images/Enemy-" + str(self.tipo) + "-Walk-" + str(i) + ".png")
         for i in [
             1,
         ]
     ]
     self.imageshit = [
         resource_path("images/Enemy-" + str(self.tipo) + "-Hit-" + str(i) + ".png")
         for i in range(1, 4)
     ]
     self.imagesatirar = [
         resource_path(
             "images/Enemy-" + str(self.tipo) + "-Attack-" + str(i) + ".png"
         )
         for i in range(1, 7)
     ]
     self.image = load(self.imageswalk[0])
     self.images_list = self.imagesstop
     self.rect = self.image.get_rect()
     self.rect.y = SCREEN_HEIGHT - random.randint(0, 500)
     self.rect.x = SCREEN_WIDTH
     self.counter = 0
     self.speed = random.randint(3, 3 + speed)
     self.sprint = 3
     self.pedras = random.randint(0, 2)
     self.reverse = False
     self.life = 6
     self.execute = self.action_parado
Exemple #12
0
 def save_state(self, path=None):
     if not path:
         path = resource_path('data')
     state_data = {}
     state_data['auto_response'] = self.state._auto_respond
     state_data['replay'] = self.state._replay
     try:
         f = open(path, 'wb')
         dump(state_data, f, HIGHEST_PROTOCOL)
         f.close()
     except PicklingError:
         print 'Error writing data file'
Exemple #13
0
 def load_state(self, path=None):
     if not path:
         path = resource_path('data')
     try:
         f = open(path, 'rb')
         data = load(f)
         f.close()
         if data:
             self.state.set_data_from_saved_state(data)
     except UnpicklingError:
         print 'Error loading data file, falling back to empty state'
         return None
     except IOError:
         print 'Error could not find file, falling back to empty state'
         return None
Exemple #14
0
 def __init__(self, x, y, direction):
     super(PedraPlayer, self).__init__()
     self.images = [
         resource_path("images/pedra.png"),
     ]
     self.image = load(self.images[0])
     self.rect = self.image.get_rect()
     self.rect.y = y + 15
     self.counter = 0
     self.speed = random.randint(15, 20)
     self.direction = direction
     self.damage = 3
     if direction == RIGHT:
         self.rect.x = x
     if direction == LEFT:
         self.rect.x = x
Exemple #15
0
def init():
    loggers.init()

    static_url = ''
    static_dir = C.resource_path('center/servers/api/fe')

    app = Flask(__name__, static_url_path=static_url, static_folder=static_dir)

    app.secret_key = 'cmbc06dhcn83hzm2013dhucn06dsfn05'
    app.logger.debug(f'App config:{app.config}')
    app.logger.debug(f'static url path:{static_url}')
    app.logger.debug(f'static folder:{static_dir}')

    index.init_app(app)

    ocr_traditional.init_ocr()
    ocr_traditional.api.init_app(app)

    CORS(app, resources=f'{C.API_URL_PREFIX}/*')

    return app
Exemple #16
0
def set_wallpaper_from_file(filename: str):
    use = os.path.normpath(config.resource_path(filename))
    ctypes.windll.user32.SystemParametersInfoW(20, 0, use, 0)
Exemple #17
0
 def __init__(self):
     self.musica = pygame.mixer.music
     self.musica.load(resource_path("sounds/musica_fundo.ogg"))
     self.musica.set_volume(0.1)
Exemple #18
0
    elif obs_focused:
        print(colored("OBS DeFocused", "red"))
        obs_focused = False


vec = pg.math.Vector2
os.system('color')

pg.init()
screen = pg.display.set_mode((WIDTH, HEIGHT))
clock = pg.time.Clock()
pg.joystick.init()
pg.display.set_caption('[Ponyo] Mapping-Switch')
gamepads = [pg.joystick.Joystick(x) for x in range(pg.joystick.get_count())]

icon = pg.image.load(resource_path('app.ico'))
pg.display.set_icon(icon)

hwnd = win32gui.FindWindow(None, "[Ponyo] Mapping-Switch")
win32gui.MoveWindow(hwnd, CENTER_X - WIDTH, CENTER_Y - HEIGHT, WIDTH, HEIGHT,
                    True)

enable_gamepad = True
if len(gamepads) == 0:
    enable_gamepad = False
    print(colored("No Gamepad Connected, Only Run Keyboard / Mouse", "red"))

deadzone_stick = 0.1
deadzone_trigger = 0.01
stick_l = vec(0, 0)
stick_r = vec(0, 0)
Exemple #19
0
country = StringVar(w)
country.set("World")  # initial value
country_list = api.get_country_list()
option = ttk.Combobox(w, values=country_list)
option.current(country_list.index(config.load_option_from_config('country')))
option.pack(padx=10, pady=10)


def confirm():
    config.write_option_to_config('country', option.get())
    current_var.set(
        f"Your current country is {config.load_option_from_config('country')}")


confirm = ttk.Button(w, text="Change Country", command=confirm)
confirm.pack(padx=20)


def force_update():
    wallpaper.generate_wallpaper_and_set()
    showinfo("Action Complete", "Wallpaper has been set!")


confirm = ttk.Button(w, text="Set Wallpaper", command=force_update)
confirm.pack(padx=20)

w.title("Coronavirus Wallpaper")
w.iconbitmap(default=config.resource_path('img/virus.ico'))
w.config(menu=menubar)
w.geometry("320x200")
Exemple #20
0
 def get_server_status_icon(self):
     if self.ui.isServerRunning():
         return QtGui.QIcon(resource_path('assets/off-icon.png'))
     return QtGui.QIcon(resource_path('assets/on-icon.png'))