duarteocarmo / coronabar

🦠 A menu bar app to track coronavirus cases all over the world
https://github.com/duarteocarmo/coronabar
MIT License
39 stars 7 forks source link

Python3 + Gtk code to run coronabar in Ubuntu Linux #2

Closed lapisdecor closed 4 years ago

lapisdecor commented 4 years ago

To test please install the dependencies stated on README.md. To run:

duarteocarmo commented 4 years ago

Hey @lapisdecor! Thanks for the contribution! Code is looking good! How are you planning to package it up?

lapisdecor commented 4 years ago

Hey @lapisdecor! Thanks for the contribution! Code is looking good! How are you planning to package it up?

I'm thinking about making a snap.

duarteocarmo commented 4 years ago

Can you post the snap here? I'll go through the code and create a new release today 🤓

lapisdecor commented 4 years ago

The snap will take some time to make, it's not trivial. As soon as I can I'll post it here.

duarteocarmo commented 4 years ago

Great! Once you do, we can add the code and the snap to the release :)

lapisdecor commented 4 years ago

Great! Once you do, we can add the code and the snap to the release :)

I'm having some trouble with setup.py. I've changed it to choose between Mac and Linux but snapcraft tries to install rumps on linux anyway.

duarteocarmo commented 4 years ago

Humm can't you specify the directory?

Have you tried this?

lapisdecor commented 4 years ago

The snap is basically done, the only problem is setup.py because snapcraft will search for packages and try to install them. There wouldn't be a problem if the setup.py file was only made for Ubuntu purposes, but I kept your code, here's my setup.py

from setuptools import setup, find_packages
import sys

APP = []
DATA_FILES = []
OPTIONS = {}
SETUP = []
INSTALL = []
SCRIPT = []

if sys.platform.startswith('darwin'):
    APP = ['app.py']
    DATA_FILES = []
    OPTIONS = {'py2app': {
        'argv_emulation': True,
        'iconfile': 'icon.icns',
        'plist': {
            'CFBundleShortVersionString': '0.2.0',
            'LSUIElement': True,
        },
        'packages': ['rumps', 'requests'],
    }}
    SETUP = ['py2app']
    INSTALL =  ['rumps', 'requests']
    SCRIPT = []
elif sys.platform.startswith('linux'):
    APP = ['app.py']
    DATA_FILES = []
    OPTIONS = {
            'packages': [],
        }
    SETUP = []
    SCRIPT = ['bin/coronabar']

setup(
        app=APP,
        name='CoronaBar',
        data_files=DATA_FILES,
        options=OPTIONS,
        setup_requires=SETUP,
        install_requires=INSTALL,
        scripts=SCRIPT
        )
duarteocarmo commented 4 years ago

@lapisdecor eu devo por o teu codigo num folder "linux", portanto cria um setup.py. Não faz sentido usarmos o mesmosetup.py se estivermos a compilar para duas plataformas com duas ferramentas differentes.

lapisdecor commented 4 years ago

@lapisdecor eu devo por o teu codigo num folder "linux", portanto cria um setup.py. Não faz sentido usarmos o mesmosetup.py se estivermos a compilar para duas plataformas com duas ferramentas differentes.

I already have my code on a Ubuntu folder, maybe there should be a mac folder too, but I'm not sure how snapcraft behaves if it doesn't find setup.py on the top directory. I will try 'snacrafting' from inside Ubuntu directory with setup.py there and see what happens.

lapisdecor commented 4 years ago

The snap is now working (with the conditional setup.py) I'm testing it.

lapisdecor commented 4 years ago

Está a funcionar no Ubuntu, já coloquei na loja. Podes testar com sudo snap install coronabar --edge