From 437720e516dccce9bf21dfaf3e71e1d4e7d19046 Mon Sep 17 00:00:00 2001 From: "paolo.cinquegrana@elettra.eu" <paolo.cinquegrana@elettra.eu> Date: Fri, 27 May 2022 18:00:25 +0200 Subject: [PATCH] cambiato makefile per python3 --- Makefile | 5 +++-- src/{laser-feedbacks.py => LaserFeedbacks.py} | 15 +++------------ 2 files changed, 6 insertions(+), 14 deletions(-) rename src/{laser-feedbacks.py => LaserFeedbacks.py} (98%) mode change 100755 => 100644 diff --git a/Makefile b/Makefile index 62d2a13..9bd13e0 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,13 @@ NAME = laser-feedbacks-gui -MAIN = laser-feedbacks.py +MAIN = LaserFeedbacks.py DIRNAME = $(NAME:-gui=) +MODNAME = $(MAIN:.py=) PY_FILES += $(wildcard src/*.py) default: bin ${PY_FILES} @cp ${PY_FILES} bin/${DIRNAME} - @echo "#!/bin/bash\nexec /runtime/bin/${DIRNAME}/${MAIN}" > bin/${NAME} + @echo "#!/usr/bin/env python3\nimport sys\nsys.path.append(sys.path[0]+'/${DIRNAME}')\nfrom ${MODNAME} import main\nif __name__ == '__main__':\n main()\n" > bin/${NAME} @chmod +x bin/${NAME} bin/${DIRNAME}/${MAIN} bin: diff --git a/src/laser-feedbacks.py b/src/LaserFeedbacks.py old mode 100755 new mode 100644 similarity index 98% rename from src/laser-feedbacks.py rename to src/LaserFeedbacks.py index fd6d72c..0951b26 --- a/src/laser-feedbacks.py +++ b/src/LaserFeedbacks.py @@ -1,4 +1,6 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 +# -*- coding:utf-8 -*- + import PyTango from PyQt4.QtCore import * @@ -449,16 +451,5 @@ class MainWindow(QDialog): app = QApplication([]) -try: - tmpdim = sys.argv[1] - tmpdim = tmpdim.split('x') - dimensione = [float(tmpdim[0]), float(tmpdim[1])] -except: - screen = QDesktopWidget().screenGeometry() - dimensione = [screen.width()*0.7, screen.height()*0.7] -font_pannello = QFont("Arial", round(dimensione[0]/160.0), -1, False) -font_grosso = QFont("Arial", round(dimensione[0]/100.0), -1, True) -app.setFont(font_pannello) main = MainWindow() -main.show() app.exec_() \ No newline at end of file -- GitLab