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

TGINSIGHT SIMILAR POSTS

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

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

Установить свойства виджета в PySide можно не только через соответствующие методы и конструктор класса. Можно их изменять с помощью метода setProperty по имени. btn = QPushButton("Click Me") btn.setProperty("flat", True) Это аналогично вызову btn.setFlat(True) Если указать несуществующее свойство, то оно просто создается btn.setProperty("btnType", "super") Получить его значение можно методом .property(name) btn_type = btn.property("btnType") Когда это может быть полезно? ▫️Можно просто хранить какие то данные в виджете и потом их доставать обратно widget = QWidget() widget.setProperty('my_data', 123) print(widget.property('my_data')) ▫️ Назначая эти свойства разным виджетам можно потом отличить виджеты во время итераци по ним. Например, найти все кнопки со свойством my_data="superbtn". Но ведь вместо кастомного свойства можно использовать objectName, будет тот же результат. Да, но y ObjectName есть ограничение - только строки. ▫️ Если нам потребуется не просто поиск а, например, сортировка по числу, то свойства позволяют нам это сделать. Поддерживается любой тип данных widget.setProperty('my_data', {'Key': 'value'}) widget.setProperty('order', 1) all_widgets.sort(key=w: w.property('order')) Но ведь Python позволяет всё вышеперечисленное сделать простым созданием атрибута у объекта widget.order = 1 widget.my_data = 123 Да, но я думаю что не надо объяснять почему не стоит так делать. К тому же, если у виджета нет свойства то метод .property(name) вернет None, а отсутствующий атрибут выбросит исключение. ▫️ Действительно полезное применение кастомным свойствам - контроль стилей. Здесь атрибутами не обойтись, нужны именно свойства. Дело в том, что в селекторах стилей можно указывать конкретные свойства виджетов на которые следует назначать стиль. Просто запустите этот код from PySide2.QtWidgets import * if __name__ == "__main__": app = QApplication([]) widget = QWidget(minimumWidth=300) layout = QVBoxLayout(widget) btn1 = QPushButton("Action 1") btn2 = QPushButton("Action 2") btn3 = QPushButton("Action 3", flat=True) layout.addWidget(btn1) layout.addWidget(btn2) layout.addWidget(btn3) # добавим кастомное свойство одной кнопке btn1.setProperty("btnType", "super") # добавляем стили widget.setStyleSheet( """ QPushButton[btnType="super"] { background-color: yellow; color: red; } QPushButton[flat="true"] { color: yellow; } """ ) widget.show() app.exec_() С помощью селектора мы избирательно назначили стили на конкретные кнопки. Как получить список всех кастомный свойств? Функция получения списка кастомных свойств отличается от получения дефолтных. def print_widget_dyn_properties(widget): for prop_name in widget.dynamicPropertyNames(): property_name = prop_name.data().decode() property_value = widget.property(property_name) print(f"{property_name}: {property_value}") #tricks#qt

Hashtags

Резултати

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

Пребарај: #nginx

当前筛选 #nginx清除筛选
Linuxgram 🐧

@linuxgram · Post #18783 · 13.05.2026 г., 21:48

📰 Nginx 1.31 Released with HTTP Forward Proxy Support Nginx 1.31 introduces HTTP forward proxy support and addresses security vulnerabilities in HTTP/2, HTTP/3, OCSP, and core modules. 🔗 Source: https://linuxiac.com/nginx-1-31-released-with-http-forward-proxy-support/ #nginx

Hashtags

Linuxgram 🐧

@linuxgram · Post #18541 · 23.04.2026 г., 08:17

📰 Kubernetes sets a new standard for release notes, also kills Ingress NGINX Release team explains links between Version 1.36 and classic print The Great Wave off Kanagawa Kubernetes issued a new release called “Haru” on Wednesday, and the release notes and logo might be more interesting than the software.… 🔗 Source: https://go.theregister.com/feed/www.theregister.com/2026/04/23/kubernetes_1_36_haru/ #nginx

Hashtags

Linuxgram 🐧

@linuxgram · Post #18472 · 17.04.2026 г., 15:45

📰 I don't use Tailscale or Nginx to access my home lab remotely, here's what I use instead One of the most useful services to any home labber is a VPN, so that you can access your home network from anywhere and browse as if you're at home. That not only lets you use any self-hosted services you have on your NAS without having to open ports to the wider internet, but it also circumvents any geo-blocked services and nicely encrypts your data, so nobody can snoop in. 🔗 Source: https://www.xda-developers.com/i-dont-use-tailscale-or-nginx-to-access-my-home-lab-remotely-heres-what-i-use-instead/ #nginx

Hashtags

Linuxgram 🐧

@linuxgram · Post #18433 · 14.04.2026 г., 15:37

📰 Nginx 1.30 Released With Multipath TCP, ECH & More Nginx 1.30 was just released as the newest stable version of this popular web server. Nginx 1.30 incorporates all of the changes from the Nginx 1.29.x mainline branch to provide a lot of new functionality like Multipath TCP (MPTCP)... 🔗 Source: https://www.phoronix.com/news/Nginx-1.30-Released #nginx

Hashtags

Linuxgram 🐧

@linuxgram · Post #18231 · 29.03.2026 г., 11:48

📰 Nginx 1.29.7 Delivers Multipath TCP Support Released this week was Nginx 1.29.7 as the newest mainline version of this HTTP(S) web server. Releasing alongside Nginx 1.28.3 stable, it fixed buffer overflow vulnerabilities and some other vulnerabilities. Making Nginx 1.29.7 more exciting though is that it landed Multipath TCP support... 🔗 Source: https://www.phoronix.com/news/Nginx-1.29.7-Multipath-TCP #nginx

Hashtags

Linuxgram 🐧

@linuxgram · Post #17812 · 17.02.2026 г., 19:12

📰Nginx Proxy Manager 2.14 Drops armv7 Support Nginx Proxy Manager 2.14 removes armv7/armhf builds and introduces a new setting for advanced proxy configurations. 🔗 Source: https://linuxiac.com/nginx-proxy-manager-2-14-drops-armv7-support/ #nginx

Hashtags

OKHK 👀

@iokhk · Post #9828 · 14.05.2026 г., 03:18

🔴 NGINX http_rewrite 模块漏洞;或会导致堆溢出甚至远程代码执行。 - 漏洞的起因是 nginx 尝试将 escape 过的 URL 写入未 escape 长度的内存。 - 在 ASLR 未被开启的情况下,可以导致远程代码执行。 - 修复已于 1.30.1/1.31.0 发布。 1. https://depthfirst.com/nginx-rift 2. my.f5.com/~ CVE: CVE-2026-42945 CVSS: 9.2 (F5 Networks) Affect: [0.6.27, 1.30.0] Fixed-At: 1.30.1, 1.31.0 #nginx

Hashtags

infosecurity

@tg_infosec · Post #3279 · 10.06.2025 г., 12:33

👩‍💻 Attacking Nginx. • Nginx — это веб-сервер, на котором работает треть всех сайтов в мире. Но если забыть или проигнорировать некоторые ошибки в настройках, можно стать отличной мишенью для атакующих: • Missing Root Location in Nginx Configuration: - Explanation; - The Missing Root Location Issue. • Attack Scenario: Exploiting the Missing Root Location: - Mitigating the Risk. • Unsafe Path Restriction in Nginx: - Explanation; - Potential Bypass Techniques; - Attack Scenario: Exploiting Path Restriction Bypass; - Mitigation Strategies. • Unsafe variable use / HTTP Request Splitting: - Unsafe Use of Variables: $uri and $document_uri; - Regex Vulnerabilities; - Safe Configuration; - Attack Scenarios and Detection Techniques; - CRLF Injection and HTTP Request Splitting; - Bypassing Path Restrictions Using Encoded Characters; - Examples of Vulnerable Configurations. • Raw Backend Response Reading: - Example Scenario: Exposing Raw Backend Responses; - Example uWSGI Application; - Nginx Configuration; - Example Invalid HTTP Request; - Example Output for Invalid Request; - Attack Scenario; - Mitigation Strategies. • merge_slashes set to off: - merge_slashes Directive; - Malicious Response Headers; - map Directive Default Value; - DNS Spoofing Vulnerability; - proxy_pass and internal Directives. • proxy_set_header Upgrade & Connection: - Vulnerable Configuration; - Vulnerability; - Attack Scenario; - Mitigation; - Additional Attack Scenarios and Commands. #Nginx

Hashtags

简悦🥑

@Xiangyues · Post #530 · 31.07.2022 г., 03:41

✨Nginx官方最新稳定版 官方源: http://nginx.org/en/linux_packages.html 官方docker: https://hub.docker.com/_/nginx 🏷 TAG #nginx#网站 📢 Channel @xiangyues 👥 Eren's Group @everyue

djangoproject

@djangoproject · Post #337 · 09.05.2017 г., 08:28

http://blog.povilasb.com/posts/python-asyncio-vs-nginx-performance/ While I was playing with Python #asyncio I got interested in how well it performs serving data over TLS compared to #Nginx. So I implemented a small HTTPS server with asyncio:

infosecurity

@tg_infosec · Post #2750 · 07.12.2024 г., 08:29

👩‍💻 Nginx Path Configuration Pitfalls. • Nginx — это веб-сервер, на котором работает треть всех сайтов в мире. Но если забыть или проигнорировать некоторые ошибки в настройках, можно стать отличной мишенью для атакующих. Благодаря этому материалу, можно понять какие ошибки в конфигурациях встречаются чаще всего и как их исправить. Attacks: • Nginx Configuration Vulnerability; • Exploiting Trailing Slash Misconfiguration; • Exploiting Parent Directory Access; • Impact Without Trailing Slash on Alias; • Combined Impact. Defend Against Attacks: • Update Nginx; • Configuration Check; • Use Configuration Management; • Security Headers; • Access Control; • Directory Listing; • Alias Traversal Protection; • HTTP to HTTPS Redirect; • SSL Configuration; • Rate Limiting; • Connection Limits; • Custom Error Pages; • Gzip Compression; • Client-Side Caching; • HTTP2 Protocol; • Secure File Permissions; • Web Application Firewall (WAF); • Monitoring and Logging; • SSH Hardening; • Firewall Configuration; • Two-Factor Authentication; • Regular Backups; • Deny Hidden Files; • IP Whitelisting; • Disable Unused Modules; • Use Trailing Slash in Alias Directives; • Regular Expression Matching; • Implement Strict Location Paths. #Nginx#devsecops

ПретходнаСтраница 1 од 3Следна