mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-06 21:44:16 +02:00
Show button available for all information fields | AUR: not showing all optional dependencies
This commit is contained in:
@@ -7,10 +7,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
## [0.6.1]
|
||||
### Improvements:
|
||||
- Better warning presentation when there are several messages
|
||||
- "Show" button available for all information fields
|
||||
|
||||
### Fixes:
|
||||
- Error when retrieving suggestions
|
||||
- snapd health check when snapd.service is available
|
||||
- AUR: not showing all optional dependencies ( Info )
|
||||
|
||||
|
||||
## [0.6.0] 2019-09-25
|
||||
|
||||
@@ -6,7 +6,7 @@ from bauh.api.abstract.handler import ProcessWatcher
|
||||
from bauh.commons.system import run_cmd, new_subprocess, new_root_subprocess, SystemProcess, ProcessHandler
|
||||
|
||||
RE_DEPS = re.compile(r'[\w\-_]+:[\s\w_\-\.]+\s+\[\w+\]')
|
||||
|
||||
RE_OPTDEPS = re.compile(r'[\w\._\-]+\s*:')
|
||||
|
||||
def is_enabled() -> bool:
|
||||
try:
|
||||
@@ -43,7 +43,7 @@ def get_info(pkg_name) -> str:
|
||||
def get_info_list(pkg_name: str) -> List[tuple]:
|
||||
info = get_info(pkg_name)
|
||||
if info:
|
||||
return re.findall(r'(\w+\s?\w+)\s+:\s+(.+(\n\s+.+)*)', info)
|
||||
return re.findall(r'(\w+\s?\w+)\s*:\s*(.+(\n\s+.+)*)', info)
|
||||
|
||||
|
||||
def get_info_dict(pkg_name: str) -> dict:
|
||||
@@ -53,14 +53,13 @@ def get_info_dict(pkg_name: str) -> dict:
|
||||
info_dict = {}
|
||||
for info_data in info_list:
|
||||
attr = info_data[0].lower().strip()
|
||||
info_dict[attr] = info_data[1] if '\n' not in info_data[1] else ' '.join(
|
||||
[l.strip() for l in info_data[1].split('\n')])
|
||||
info_dict[attr] = info_data[1]
|
||||
|
||||
if info_dict[attr] == 'None':
|
||||
info_dict[attr] = None
|
||||
|
||||
if attr == 'optional deps' and info_dict[attr]:
|
||||
info_dict[attr] = RE_DEPS.findall(info_dict[attr])
|
||||
info_dict[attr] = info_dict[attr].split('\n')
|
||||
elif attr == 'depends on' and info_dict[attr]:
|
||||
info_dict[attr] = [d.strip() for d in info_dict[attr].split(' ') if d]
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ from PyQt5.QtGui import QIcon
|
||||
from PyQt5.QtWidgets import QDialog, QVBoxLayout, QGroupBox, \
|
||||
QLineEdit, QLabel, QGridLayout, QPushButton, QPlainTextEdit, QToolBar
|
||||
from bauh.api.abstract.cache import MemoryCache
|
||||
from bauh.commons.html import strip_html
|
||||
|
||||
IGNORED_ATTRS = {'name', '__app__'}
|
||||
|
||||
@@ -54,8 +53,6 @@ class InfoDialog(QDialog):
|
||||
else:
|
||||
val = str(app[attr]).strip()
|
||||
|
||||
full_val = None
|
||||
|
||||
i18n_val = locale_keys.get('{}.{}'.format(i18n_key, val.lower()))
|
||||
|
||||
if i18n_val:
|
||||
@@ -63,13 +60,6 @@ class InfoDialog(QDialog):
|
||||
|
||||
text = QLineEdit()
|
||||
text.setToolTip(val)
|
||||
|
||||
if len(val) > 80:
|
||||
full_val = val
|
||||
self.full_vals.append(full_val)
|
||||
val = strip_html(val)
|
||||
val = val[0:80] + '...'
|
||||
|
||||
text.setText(val)
|
||||
text.setCursorPosition(0)
|
||||
text.setStyleSheet("width: 400px")
|
||||
@@ -80,9 +70,7 @@ class InfoDialog(QDialog):
|
||||
|
||||
self.gbox_info_layout.addWidget(label, idx, 0)
|
||||
self.gbox_info_layout.addWidget(text, idx, 1)
|
||||
|
||||
if full_val is not None:
|
||||
self._gen_show_button(idx, full_val)
|
||||
self._gen_show_button(idx, val)
|
||||
|
||||
self.adjustSize()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user