Merge branch 'vnc' of git://github.com/ChrisPattison/rmview into package

This commit is contained in:
Emanuele 2020-09-11 02:53:43 +02:00
commit f64c65ed7e
11 changed files with 77 additions and 8 deletions

2
pyproject.toml Normal file
View file

@ -0,0 +1,2 @@
[build-system]
requires = ["setuptools", "PyQt5"]

7
setup.cfg Normal file
View file

@ -0,0 +1,7 @@
[options]
package_dir=
=src
packages=find:
[options.packages.find]
where=src

53
setup.py Normal file
View file

@ -0,0 +1,53 @@
from setuptools.command.install import install
from setuptools.command.develop import develop
from setuptools.command.egg_info import egg_info
from setuptools import setup, find_packages
import sys
def genResources():
from PyQt5.pyrcc_main import main as pyrcc_main
saved_argv = sys.argv
# Use current environment to find pyrcc but use the public interface
sys.argv = ['pyrcc5', '-o', 'src/rmview/resources.py', 'resources.qrc']
pyrcc_main()
sys.argv = saved_argv
# https://stackoverflow.com/questions/19569557/pip-not-picking-up-a-custom-install-cmdclass
class genResourcesInstall(install):
def run(self):
genResources()
install.run(self)
class genResourcesDevelop(develop):
def run(self):
genResources()
develop.run(self)
class genResourcesEggInfo(egg_info):
def run(self):
genResources()
egg_info.run(self)
setup(
name='rmview',
version='0.1',
url='https://github.com/bordaigorl/rmview',
description='rMview: a fast live viewer for reMarkable',
author='bordaigorl',
author_email='emanuele.dosualdo@gmail.com',
classifiers=[
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
],
packages=['rmview'],
install_requires=['pyqt5', 'paramiko', 'twisted'],
entry_points={
'console_scripts':['rmview = rmview.rmview:rmViewMain']
},
cmdclass={
'install': genResourcesInstall,
'develop': genResourcesDevelop,
'egg_info': genResourcesEggInfo,
}
)

0
src/rmview/__init__.py Normal file
View file

4
src/rmview/__main__.py Normal file
View file

@ -0,0 +1,4 @@
from .rmview import *
if __name__ == '__main__':
rmViewMain()

View file

@ -2,12 +2,12 @@ from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
import resources
from workers import FrameBufferWorker, PointerWorker
from connection import rMConnect
from viewer import QtImageViewer
from . import resources
from .workers import FrameBufferWorker, PointerWorker
from .connection import rMConnect
from .viewer import QtImageViewer
from rmparams import *
from .rmparams import *
import sys
import os
@ -264,9 +264,12 @@ class rMViewApp(QApplication):
QMessageBox.critical(self.viewer, "Error", 'Please check your reMarkable is properly configured, see the documentation for instructions.\n\n%s' % e)
self.quit()
if __name__ == '__main__':
def rmViewMain():
log.setLevel(logging.INFO)
QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
ecode = rMViewApp(sys.argv).exec_()
print('\nBye!')
sys.exit(ecode)
if __name__ == '__main__':
rmViewMain()

View file

@ -2,7 +2,7 @@ from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from rmparams import *
from .rmparams import *
import paramiko
import struct
@ -17,7 +17,7 @@ from twisted.internet.protocol import Protocol
from twisted.internet import protocol, reactor
from twisted.application import internet, service
from rfb import *
from .rfb import *
try:
IMG_FORMAT = QImage.Format_Grayscale16