mirror of
https://github.com/ralsina/xrandroll.git
synced 2024-11-22 02:52:23 +00:00
packaging via poetry
This commit is contained in:
parent
8cfd0072cd
commit
90fe2990bc
@ -14,7 +14,7 @@ So I went and wrote one.
|
|||||||
|
|
||||||
## To try:
|
## To try:
|
||||||
|
|
||||||
If you have PySide2: `python main.py` in the folder where main.py is located.
|
If you have PySide2: `python -m xrandroll` in the folder where main.py is located.
|
||||||
|
|
||||||
## TODO:
|
## TODO:
|
||||||
|
|
||||||
|
24
pyproject.toml
Normal file
24
pyproject.toml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
[tool.poetry]
|
||||||
|
name = "xrandroll"
|
||||||
|
version = "0.1.0"
|
||||||
|
description = "A powertool to configure your display"
|
||||||
|
authors = ["Roberto Alsina <roberto.alsina@gmail.com>"]
|
||||||
|
license = "MIT"
|
||||||
|
readme = "README.md"
|
||||||
|
packages = [
|
||||||
|
{ include = "xrandroll" }
|
||||||
|
]
|
||||||
|
|
||||||
|
[tool.poetry.dependencies]
|
||||||
|
pyside2 = ">5.14"
|
||||||
|
python = ">3.6"
|
||||||
|
|
||||||
|
|
||||||
|
[tool.poetry.dev-dependencies]
|
||||||
|
|
||||||
|
[build-system]
|
||||||
|
requires = ["poetry>=0.12"]
|
||||||
|
build-backend = "poetry.masonry.api"
|
||||||
|
|
||||||
|
[tool.poetry.scripts]
|
||||||
|
xrandroll = 'xrandroll:main'
|
1
xrandroll/__init__.py
Normal file
1
xrandroll/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
from .__main__ import main
|
@ -1,13 +1,14 @@
|
|||||||
from copy import deepcopy
|
import os
|
||||||
import shlex
|
import shlex
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
from copy import deepcopy
|
||||||
|
|
||||||
from PySide2.QtCore import QFile, QObject
|
from PySide2.QtCore import QFile, QObject
|
||||||
from PySide2.QtUiTools import QUiLoader
|
from PySide2.QtUiTools import QUiLoader
|
||||||
from PySide2.QtWidgets import QApplication, QGraphicsScene, QLabel
|
from PySide2.QtWidgets import QApplication, QGraphicsScene, QLabel
|
||||||
|
|
||||||
from monitor_item import MonitorItem
|
from .monitor_item import MonitorItem
|
||||||
|
|
||||||
|
|
||||||
def gen_xrandr_from_data(data):
|
def gen_xrandr_from_data(data):
|
||||||
@ -373,14 +374,17 @@ class Window(QObject):
|
|||||||
self.ui.verticalScaleLabel.setText(f"{int(self.ui.verticalScale.value()/10)}%")
|
self.ui.verticalScaleLabel.setText(f"{int(self.ui.verticalScale.value()/10)}%")
|
||||||
self.mode_changed() # Not really, but it's the same thing
|
self.mode_changed() # Not really, but it's the same thing
|
||||||
|
|
||||||
|
def main():
|
||||||
if __name__ == "__main__":
|
|
||||||
app = QApplication(sys.argv)
|
app = QApplication(sys.argv)
|
||||||
|
|
||||||
ui_file = QFile("main.ui")
|
ui_file = QFile(os.path.join(os.path.dirname(__file__), "main.ui"))
|
||||||
ui_file.open(QFile.ReadOnly)
|
ui_file.open(QFile.ReadOnly)
|
||||||
|
|
||||||
loader = QUiLoader()
|
loader = QUiLoader()
|
||||||
window = Window(loader.load(ui_file))
|
window = Window(loader.load(ui_file))
|
||||||
|
|
||||||
sys.exit(app.exec_())
|
sys.exit(app.exec_())
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
Loading…
Reference in New Issue
Block a user