TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #175 · 30 окт.

В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль QtCompat (compatibility). Там не так много функций но они довольно полезны. Этот модуль содержит унификаци модуля shiboken2, функций loadUi, translate и несколько переименованных функций классов или изменённую сигнатуру аргументов и возвращаемых значений. Это единственное исключение из правила когда вам потребуется где-то изменить свой код кроме импортов и этот код не похож на обычный код PySide2. Например, в PyQt4 и PySide есть метод QHeaderView.setResizeMode Для PyQt5 и PySide2 они были благополучно переименованы в QHeaderView.setSectionResizeMode Чтобы применить этот метод следует использовать такой код from Qt import QtCompath header = self.horizontalHeader() QtCompat.QHeaderView.setSectionResizeMode(header, QtWidgets.QHeaderView.Fixed) Унификация загрузки UI файлов: # PySide2 from PySide2.QtUiTools import QUiLoader loader = QUiLoader() widget = loader.load(ui_file) # PyQt5 from PyQt5 import uic widget = uic.loadUi(ui_file) # Qt.py from Qt import QtCompat widget = QtCompat.loadUi(ui_file) Хорошо что таких моментов не много и их легко запомнить. Полный список можно посмотреть в таблице. #qt#tricks

Hashtags

Резултати

Пронајдени 3 слични објави

Пребарај: #yatube

当前筛选 #yatube清除筛选
Luckydonalds Bots: Development/Status

@luckydonaldsbots · Post #157 · 30.08.2018 г., 22:54

Improved @YATubeBot's format selection to download the optimal quality settings to fit telegram's file limit of 50mb for video and songs. The audio is always loaded in highest quality so both the merged video file and the mp3 version benefits. Also fixed being able to queue more than one video at a time unintentionally. This should make the bot far more stable and faster. #YATube#update

Luckydonalds Bots: Development/Status

@luckydonaldsbots · Post #166 · 25.11.2018 г., 14:47

Updated @YATubeBot to be more clear of errors related to upload size. Will now handle file size related upload errors more transparent, telling you exactly what's going on, instead of just stopping sending any updates after "Uploading...". Now it will check file size before uploading, and also handle rare errors raised (in an unspecified way) by telegram. Technical background: The telegram API returns a HTML error message instead of the usual json response, which of course isn't mentioned anywere in the API documentation. This broke pytgbot, the library used to interact with the API. The package was fixed to be able to handle that. Now also provides the file size of the file to upload in an easy accessable way, so that the upload size can be checked before uploading. #update#YATube#pytgbot#TechnicalDetails

Luckydonalds Bots: Development/Status

@luckydonaldsbots · Post #161 · 21.10.2018 г., 08:02

Downtime yesterday TL;DR: After a restart, not all services got back online. Turns out, when I refreshed my docker-machine certificates, which it uses to securely talk to my remote server, it had to restart docker. Those certificates work for 3 years and have to be recreated if they expire. (Wow, I'm working with telegram bots for a while now, huh?) Somehow some services (e.g. @YATubeBot, @ForwardWhitelistBot) didn't restart, and the @StickerTagBot even reverted to a old version from last year. Anyway I redeployed the correct version. If something else isn't running how it used to, please contact me personally @luckydonald. #downtime#TechnicalDetails#YATube#ForwardWhitelist#StickerTag