Merge pull request #43 from octopusSD/hdpi_fix

Fix images issues on HDPI resolution
This commit is contained in:
Vinícius Moreira
2020-01-09 16:08:44 -03:00
committed by GitHub
50 changed files with 1083 additions and 120 deletions

View File

@@ -4,10 +4,27 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [0.8.1]
### Improvements
- All icons are now SVG files
- HDPI support ( by [octopusSD](https://github.com/octopusSD) )
- Web:
- not using HTTP sessions anymore to perform the searches. It seems to avoid URLs not being found after an internet drop event.
### Fixes
- missing categories i18n [48](https://github.com/vinifmor/bauh/issues/48)
- not verifying if an icon path is a file
- Web:
- not handling HTTP connection issues
- not passing the Home path as a String ( does not work in Python 3.5 )
### UI
- Default **Type** icon removed from the Type filter to make the design more consistent with the Category filter.
## [0.8.0] 2019-12-24
### Features
- Native Web applications support:
- if an URL is typed in the search bar, a native web application result will be displayed in the results table.
- if an URL is typed on the search bar, a native web application result will be displayed on the table.
- bauh relies on [NodeJS](https://nodejs.org/en/), [Electron](https://electronjs.org/) and [nativefier](https://github.com/jiahaog/nativefier) to install the Web applications, but there is no need to have them installed on your system. Bauh will create its own installation environment with these technologies in **~/.local/share/bauh/web/env**.
- suggestions are retrieved from [suggestions.txt](https://github.com/vinifmor/bauh-files/blob/master/web/suggestions.yml)
- requires only **python-beautifulsoup4** and **python-lxml** to be enabled

View File

@@ -1,4 +1,4 @@
__version__ = '0.8.0'
__version__ = '0.8.1'
__app_name__ = 'bauh'
import os

View File

@@ -1,6 +1,5 @@
from pathlib import Path
HOME_PATH = Path.home()
CACHE_PATH = '{}/.cache/bauh'.format(HOME_PATH)
CONFIG_PATH = '{}/.config/bauh'.format(HOME_PATH)
DESKTOP_ENTRIES_DIR = '{}/.local/share/applications'.format(HOME_PATH)
CACHE_PATH = '{}/.cache/bauh'.format(Path.home())
CONFIG_PATH = '{}/.config/bauh'.format(Path.home())
DESKTOP_ENTRIES_DIR = '{}/.local/share/applications'.format(Path.home())

View File

@@ -17,7 +17,7 @@ class HttpClient:
self.sleep = sleep
self.logger = logger
def get(self, url: str, params: dict = None, headers: dict = None, allow_redirects: bool = True, ignore_ssl: bool = False, single_call: bool = False) -> requests.Request:
def get(self, url: str, params: dict = None, headers: dict = None, allow_redirects: bool = True, ignore_ssl: bool = False, single_call: bool = False, session: bool = True) -> requests.Response:
cur_attempts = 1
while cur_attempts <= self.max_attempts:
@@ -35,7 +35,10 @@ class HttpClient:
if ignore_ssl:
args['verify'] = False
res = self.session.get(url, **args)
if session:
res = self.session.get(url, **args)
else:
res = requests.get(url, **args)
if res.status_code == 200:
return res
@@ -56,20 +59,20 @@ class HttpClient:
self.logger.warning("Could not retrieve data from '{}'".format(url))
def get_json(self, url: str, params: dict = None, headers: dict = None, allow_redirects: bool = True):
res = self.get(url, params=params, headers=headers, allow_redirects=allow_redirects)
def get_json(self, url: str, params: dict = None, headers: dict = None, allow_redirects: bool = True, session: bool = True):
res = self.get(url, params=params, headers=headers, allow_redirects=allow_redirects, session=session)
return res.json() if res else None
def get_yaml(self, url: str, params: dict = None, headers: dict = None, allow_redirects: bool = True):
res = self.get(url, params=params, headers=headers, allow_redirects=allow_redirects)
def get_yaml(self, url: str, params: dict = None, headers: dict = None, allow_redirects: bool = True, session: bool = True):
res = self.get(url, params=params, headers=headers, allow_redirects=allow_redirects, session=session)
return yaml.safe_load(res.text) if res else None
def get_content_length(self, url: str) -> str:
"""
:param url:
:return:
"""
res = self.session.get(url, allow_redirects=True, stream=True)
def get_content_length(self, url: str, session: bool = True) -> str:
params = {'url': url, 'allow_redirects': True, 'stream': True}
if session:
res = self.session.get(**params)
else:
res = requests.get(**params)
if res.status_code == 200:
size = res.headers.get('Content-Length')
@@ -77,6 +80,11 @@ class HttpClient:
if size is not None:
return system.get_human_size_str(size)
def exists(self, url: str) -> bool:
res = self.session.head(url=url, allow_redirects=True, verify=False, timeout=5)
def exists(self, url: str, session: bool = True) -> bool:
params = {'url': url, 'allow_redirects': True, 'verify': False, 'timeout': 5}
if session:
res = self.session.head(**params)
else:
res = self.session.get(**params)
return res.status_code in (200, 403)

View File

@@ -3,6 +3,7 @@ import sys
from threading import Thread
import urllib3
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QApplication
@@ -71,6 +72,7 @@ def main():
app.setApplicationVersion(__version__)
app_icon = util.get_default_icon()[1]
app.setWindowIcon(app_icon)
app.setAttribute(Qt.AA_UseHighDpiPixmaps) # This fix images on HDPI resolution, not tested on non HDPI
if local_config['ui']['style']:
app.setStyle(str(local_config['ui']['style']))

View File

@@ -1,8 +1,7 @@
import os
from bauh.api.constants import HOME_PATH
from pathlib import Path
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
LOCAL_PATH = '{}/.local/share/bauh/appimage'.format(HOME_PATH)
LOCAL_PATH = '{}/.local/share/bauh/appimage'.format(Path.home())
INSTALLATION_PATH = LOCAL_PATH + '/installed/'
SUGGESTIONS_FILE = 'https://raw.githubusercontent.com/vinifmor/bauh-files/master/appimage/suggestions.txt'

View File

@@ -20,15 +20,14 @@ from bauh.api.abstract.handler import ProcessWatcher
from bauh.api.abstract.model import SoftwarePackage, PackageHistory, PackageUpdate, PackageSuggestion, \
SuggestionPriority
from bauh.api.abstract.view import MessageType
from bauh.api.constants import HOME_PATH
from bauh.commons.html import bold
from bauh.commons.system import SystemProcess, new_subprocess, ProcessHandler, run_cmd, SimpleProcess
from bauh.gems.appimage import query, INSTALLATION_PATH, LOCAL_PATH, SUGGESTIONS_FILE
from bauh.gems.appimage.config import read_config
from bauh.gems.appimage.model import AppImage
from bauh.gems.appimage.query import FIND_APPS_BY_NAME, FIND_APPS_BY_NAME_ONLY_NAME
from bauh.gems.appimage.worker import DatabaseUpdater
HOME_PATH = str(Path.home())
DB_APPS_PATH = '{}/{}'.format(HOME_PATH, '.local/share/bauh/appimage/apps.db')
DB_RELEASES_PATH = '{}/{}'.format(HOME_PATH, '.local/share/bauh/appimage/releases.db')

View File

@@ -46,7 +46,7 @@ class AppImage(SoftwarePackage):
return self.get_type_icon_path()
def get_type_icon_path(self):
return resource.get_path('img/appimage.png', ROOT_DIR)
return resource.get_path('img/appimage.svg', ROOT_DIR)
def is_application(self):
return True

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1,335 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="24"
height="23.909061"
id="svg3832"
version="1.1"
inkscape:version="0.92.4 5da689c313, 2019-01-14"
sodipodi:docname="appimage.svg">
<defs
id="defs3834">
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3308-4-6-931-761-0"
id="linearGradient2975"
gradientUnits="userSpaceOnUse"
x1="24.3125"
y1="22.96875"
x2="24.3125"
y2="41.03125" />
<linearGradient
id="linearGradient3308-4-6-931-761-0">
<stop
id="stop2919-2"
style="stop-color:#ffffff;stop-opacity:1"
offset="0" />
<stop
id="stop2921-76"
style="stop-color:#ffffff;stop-opacity:0"
offset="1" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4222"
id="linearGradient2979"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0,0.3704967,-0.3617496,0,33.508315,6.1670925)"
x1="7.6485429"
y1="26.437023"
x2="41.861729"
y2="26.437023" />
<linearGradient
id="linearGradient4222">
<stop
id="stop4224"
style="stop-color:#ffffff;stop-opacity:1"
offset="0" />
<stop
id="stop4226"
style="stop-color:#ffffff;stop-opacity:0"
offset="1" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3308-4-6-931-761"
id="linearGradient2982"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(0,0.9999987)"
x1="23.99999"
y1="4.999989"
x2="23.99999"
y2="43" />
<linearGradient
id="linearGradient3308-4-6-931-761">
<stop
id="stop2919"
style="stop-color:#ffffff;stop-opacity:1"
offset="0" />
<stop
id="stop2921"
style="stop-color:#ffffff;stop-opacity:0"
offset="1" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3575"
id="radialGradient2985"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0,1.0262008,-1.6561124,9.4072203e-4,-56.097482,-45.332325)"
cx="48.42384"
cy="-48.027504"
fx="48.42384"
fy="-48.027504"
r="38.212933" />
<linearGradient
id="linearGradient3575">
<stop
id="stop3577"
style="stop-color:#fafafa;stop-opacity:1"
offset="0" />
<stop
id="stop3579"
style="stop-color:#e6e6e6;stop-opacity:1"
offset="1" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3993"
id="radialGradient2990"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0,2.0478765,-2.7410544,-8.6412258e-8,47.161382,-8.837436)"
cx="9.3330879"
cy="8.4497671"
fx="9.3330879"
fy="8.4497671"
r="19.99999" />
<linearGradient
id="linearGradient3993">
<stop
offset="0"
style="stop-color:#a3c0d0;stop-opacity:1"
id="stop3995" />
<stop
offset="1"
style="stop-color:#427da1;stop-opacity:1"
id="stop4001" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2508"
id="linearGradient2992"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(0,0.9674382)"
x1="14.048676"
y1="44.137306"
x2="14.048676"
y2="4.0000005" />
<linearGradient
id="linearGradient2508">
<stop
offset="0"
style="stop-color:#2e4a5a;stop-opacity:1"
id="stop2510" />
<stop
offset="1"
style="stop-color:#6e8796;stop-opacity:1"
id="stop2512" />
</linearGradient>
<radialGradient
cx="4.9929786"
cy="43.5"
r="2.5"
fx="4.9929786"
fy="43.5"
id="radialGradient2873-966-168"
xlink:href="#linearGradient3688-166-749"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(2.003784,0,0,1.4,27.98813,-17.4)" />
<linearGradient
id="linearGradient3688-166-749">
<stop
id="stop2883"
style="stop-color:#181818;stop-opacity:1"
offset="0" />
<stop
id="stop2885"
style="stop-color:#181818;stop-opacity:0"
offset="1" />
</linearGradient>
<radialGradient
cx="4.9929786"
cy="43.5"
r="2.5"
fx="4.9929786"
fy="43.5"
id="radialGradient2875-742-326"
xlink:href="#linearGradient3688-464-309"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(2.003784,0,0,1.4,-20.01187,-104.4)" />
<linearGradient
id="linearGradient3688-464-309">
<stop
id="stop2889"
style="stop-color:#181818;stop-opacity:1"
offset="0" />
<stop
id="stop2891"
style="stop-color:#181818;stop-opacity:0"
offset="1" />
</linearGradient>
<linearGradient
x1="25.058096"
y1="47.027729"
x2="25.058096"
y2="39.999443"
id="linearGradient2877-634-617"
xlink:href="#linearGradient3702-501-757"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3702-501-757">
<stop
id="stop2895"
style="stop-color:#181818;stop-opacity:0"
offset="0" />
<stop
id="stop2897"
style="stop-color:#181818;stop-opacity:1"
offset="0.5" />
<stop
id="stop2899"
style="stop-color:#181818;stop-opacity:0"
offset="1" />
</linearGradient>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.4375"
inkscape:cx="612.29775"
inkscape:cy="-202.44753"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="1360"
inkscape:window-height="703"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
showborder="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<metadata
id="metadata3837">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer"
transform="translate(-2,-22.090907)">
<g
id="g881"
transform="matrix(0.54545433,0,0,0.58268555,0.90909135,19.196452)">
<g
transform="matrix(1.1,0,0,0.4444449,-2.4000022,25.11107)"
id="g2036"
style="display:inline">
<g
transform="matrix(1.052632,0,0,1.285713,-1.263158,-13.42854)"
id="g3712"
style="opacity:0.4">
<rect
width="5"
height="7"
x="38"
y="40"
id="rect2801"
style="fill:url(#radialGradient2873-966-168);fill-opacity:1;stroke:none" />
<rect
width="5"
height="7"
x="-10"
y="-47"
transform="scale(-1)"
id="rect3696"
style="fill:url(#radialGradient2875-742-326);fill-opacity:1;stroke:none" />
<rect
width="28"
height="7.0000005"
x="10"
y="40"
id="rect3700"
style="fill:url(#linearGradient2877-634-617);fill-opacity:1;stroke:none" />
</g>
</g>
<rect
width="39"
height="39"
rx="2.2322156"
ry="2.2322156"
x="4.5"
y="5.4674392"
id="rect5505"
style="fill:url(#radialGradient2990);fill-opacity:1;stroke:url(#linearGradient2992);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<path
d="m 21,6.9687498 a 2.0165107,2.0165107 0 0 0 -2.03125,2.03125 V 12.96875 H 17.8125 a 2.0165107,2.0165107 0 0 0 -1.5,3.375 l 5.0625,5.75 c -0.06312,0.110777 -0.178724,0.246032 -0.21875,0.34375 -0.195898,0.478256 -0.25,0.83653 -0.25,1.21875 v 0.125 L 20.8125,23.6875 C 20.534322,23.409323 20.213169,23.162739 19.71875,22.96875 19.47154,22.87176 19.185456,22.791748 18.75,22.8125 c -0.435456,0.02075 -1.054055,0.210302 -1.46875,0.625 L 15.75,24.96875 c -0.414689,0.414689 -0.604245,1.033294 -0.625,1.46875 -0.02075,0.435456 0.05925,0.721537 0.15625,0.96875 C 15.475241,27.900677 15.721817,28.221821 16,28.5 l 0.09375,0.09375 h -0.125 c -0.382218,0 -0.740493,0.0541 -1.21875,0.25 -0.239128,0.09795 -0.538285,0.214988 -0.84375,0.53125 -0.305465,0.316262 -0.625,0.914788 -0.625,1.53125 v 2.1875 c 0,0.616465 0.319536,1.214989 0.625,1.53125 0.305464,0.316261 0.604622,0.433301 0.84375,0.53125 0.478256,0.195898 0.83653,0.25 1.21875,0.25 h 0.125 L 16,35.5 c -0.278175,0.278176 -0.52476,0.599329 -0.71875,1.09375 -0.09699,0.24721 -0.177003,0.533292 -0.15625,0.96875 0.02075,0.435458 0.210304,1.054058 0.625,1.46875 l 1.53125,1.53125 c 0.414691,0.414697 1.033292,0.604245 1.46875,0.625 0.435458,0.02076 0.721537,-0.05926 0.96875,-0.15625 0.494425,-0.19399 0.81557,-0.440568 1.09375,-0.71875 l 0.09375,-0.09375 v 0.125 c 0,0.38222 0.0541,0.740495 0.25,1.21875 0.09795,0.239127 0.214989,0.538285 0.53125,0.84375 0.316261,0.305465 0.914783,0.625 1.53125,0.625 h 2.1875 c 0.616466,0 1.214989,-0.319534 1.53125,-0.625 0.316261,-0.305466 0.433302,-0.604622 0.53125,-0.84375 0.195896,-0.478255 0.25,-0.836532 0.25,-1.21875 v -0.125 l 0.09375,0.09375 c 0.278176,0.278175 0.599329,0.52476 1.09375,0.71875 0.24721,0.09699 0.533292,0.177003 0.96875,0.15625 0.435458,-0.02075 1.054058,-0.210304 1.46875,-0.625 L 32.875,39.03125 C 33.289697,38.616559 33.479245,37.997958 33.5,37.5625 33.52076,37.127042 33.44074,36.840963 33.34375,36.59375 33.14976,36.099325 32.903182,35.77818 32.625,35.5 l -0.09375,-0.09375 h 0.125 c 0.38222,0 0.740494,-0.0541 1.21875,-0.25 0.239128,-0.09795 0.538286,-0.214988 0.84375,-0.53125 0.305464,-0.316262 0.625,-0.914787 0.625,-1.53125 v -2.1875 c 0,-0.61646 -0.319535,-1.214987 -0.625,-1.53125 -0.305465,-0.316263 -0.604621,-0.433301 -0.84375,-0.53125 -0.478257,-0.195898 -0.836532,-0.25 -1.21875,-0.25 h -0.125 L 32.625,28.5 c 0.278177,-0.278177 0.52476,-0.599329 0.71875,-1.09375 C 33.44074,27.15904 33.520753,26.872957 33.5,26.4375 33.47925,26.002043 33.289697,25.383443 32.875,24.96875 L 31.34375,23.4375 c -0.414688,-0.414694 -1.03329,-0.604245 -1.46875,-0.625 -0.43546,-0.02076 -0.721537,0.05925 -0.96875,0.15625 -0.494426,0.193991 -0.815572,0.44057 -1.09375,0.71875 l -0.09375,0.09375 v -0.125 c 0,-0.382218 -0.0541,-0.740493 -0.25,-1.21875 -0.09112,-0.22245 -0.228127,-0.500183 -0.5,-0.78125 l 4.71875,-5.3125 a 2.0165107,2.0165107 0 0 0 -1.5,-3.375 H 29.03125 V 8.9999998 A 2.0165107,2.0165107 0 0 0 27,6.9687498 Z M 24.3125,31.25 c 0.427097,0 0.75,0.322904 0.75,0.75 0,0.427096 -0.322903,0.75 -0.75,0.75 -0.427094,0 -0.75,-0.322906 -0.75,-0.75 0,-0.427094 0.322906,-0.75 0.75,-0.75 z"
id="path4294-1"
style="display:inline;overflow:visible;visibility:visible;opacity:0.05;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.00178742;marker:none;enable-background:accumulate"
inkscape:connector-curvature="0" />
<path
d="m 20.90625,8.0312498 a 0.96385067,0.96385067 0 0 0 -0.875,0.96875 V 14.03125 H 17.8125 A 0.96385067,0.96385067 0 0 0 17.09375,15.625 l 5.78125,6.53125 c -0.158814,0.0616 -0.341836,0.0951 -0.4375,0.1875 -0.169161,0.163386 -0.252971,0.323419 -0.3125,0.46875 -0.119058,0.290663 -0.15625,0.566746 -0.15625,0.84375 V 25.3125 C 21.718163,25.40233 21.485871,25.509772 21.25,25.625 l -1.1875,-1.1875 c -0.199651,-0.19965 -0.421433,-0.352095 -0.71875,-0.46875 -0.148659,-0.05833 -0.329673,-0.104846 -0.5625,-0.09375 -0.232827,0.0111 -0.53583,0.09833 -0.75,0.3125 L 16.5,25.71875 c -0.214168,0.214168 -0.301403,0.517173 -0.3125,0.75 -0.0111,0.232827 0.03542,0.41384 0.09375,0.5625 0.116655,0.297321 0.269096,0.519099 0.46875,0.71875 l 1.1875,1.1875 c -0.115228,0.235871 -0.222668,0.468163 -0.3125,0.71875 h -1.65625 c -0.277003,0 -0.553087,0.03719 -0.84375,0.15625 -0.145332,0.05953 -0.305363,0.143338 -0.46875,0.3125 -0.163387,0.169162 -0.3125,0.46403 -0.3125,0.78125 v 2.1875 c 0,0.317221 0.149114,0.612089 0.3125,0.78125 0.163386,0.169161 0.323419,0.252971 0.46875,0.3125 0.290663,0.119058 0.566746,0.15625 0.84375,0.15625 H 17.625 c 0.08983,0.250587 0.197272,0.482879 0.3125,0.71875 L 16.75,36.25 c -0.199649,0.19965 -0.352095,0.421432 -0.46875,0.71875 -0.05833,0.148659 -0.104846,0.329672 -0.09375,0.5625 0.0111,0.232828 0.09833,0.535831 0.3125,0.75 l 1.53125,1.53125 c 0.214168,0.214172 0.517172,0.301403 0.75,0.3125 0.232828,0.0111 0.41384,-0.03542 0.5625,-0.09375 0.29732,-0.116655 0.519098,-0.269096 0.71875,-0.46875 L 21.25,38.375 c 0.235871,0.115228 0.468164,0.222668 0.71875,0.3125 v 1.65625 c 0,0.277003 0.03719,0.553087 0.15625,0.84375 0.05953,0.145331 0.143339,0.305364 0.3125,0.46875 0.169161,0.163386 0.464028,0.3125 0.78125,0.3125 h 2.1875 c 0.317221,0 0.612089,-0.149113 0.78125,-0.3125 0.169161,-0.163387 0.252971,-0.323419 0.3125,-0.46875 0.119057,-0.290663 0.15625,-0.566748 0.15625,-0.84375 V 38.6875 c 0.250586,-0.08983 0.482879,-0.197272 0.71875,-0.3125 l 1.1875,1.1875 c 0.19965,0.199649 0.421432,0.352095 0.71875,0.46875 0.148659,0.05833 0.329672,0.104846 0.5625,0.09375 0.232828,-0.0111 0.535831,-0.09833 0.75,-0.3125 L 32.125,38.28125 c 0.214172,-0.214168 0.301403,-0.517172 0.3125,-0.75 0.0111,-0.232828 -0.03542,-0.41384 -0.09375,-0.5625 C 32.227095,36.67143 32.074654,36.449652 31.875,36.25 L 30.6875,35.0625 C 30.802728,34.82663 30.910168,34.594337 31,34.34375 h 1.65625 c 0.277004,0 0.553087,-0.03719 0.84375,-0.15625 0.145332,-0.05953 0.305364,-0.143339 0.46875,-0.3125 0.163386,-0.169161 0.3125,-0.46403 0.3125,-0.78125 v -2.1875 c 0,-0.317219 -0.149114,-0.612088 -0.3125,-0.78125 C 33.805364,29.955838 33.645332,29.872029 33.5,29.8125 33.209336,29.693442 32.933253,29.65625 32.65625,29.65625 H 31 C 30.91017,29.405663 30.802728,29.17337 30.6875,28.9375 L 31.875,27.75 c 0.19965,-0.19965 0.352095,-0.421432 0.46875,-0.71875 0.05833,-0.148659 0.104846,-0.329672 0.09375,-0.5625 -0.0111,-0.232828 -0.09833,-0.535831 -0.3125,-0.75 L 30.59375,24.1875 c -0.214167,-0.21417 -0.517171,-0.301403 -0.75,-0.3125 -0.232829,-0.0111 -0.41384,0.03542 -0.5625,0.09375 -0.29732,0.116656 -0.519099,0.269097 -0.71875,0.46875 L 27.375,25.625 c -0.235871,-0.115228 -0.468163,-0.222668 -0.71875,-0.3125 v -1.65625 c 0,-0.277003 -0.03719,-0.553087 -0.15625,-0.84375 -0.05953,-0.145332 -0.143338,-0.305363 -0.3125,-0.46875 -0.169162,-0.163387 -0.46403,-0.3125 -0.78125,-0.3125 H 25.25 L 30.90625,15.625 A 0.96385067,0.96385067 0 0 0 30.1875,14.03125 H 27.96875 V 8.9999998 A 0.96385067,0.96385067 0 0 0 27,8.0312498 h -6 a 0.96385067,0.96385067 0 0 0 -0.09375,0 z M 24.3125,30.1875 c 1.002113,0 1.8125,0.810388 1.8125,1.8125 0,1.002112 -0.810387,1.8125 -1.8125,1.8125 C 23.31039,33.8125 22.5,33.002111 22.5,32 c 0,-1.002111 0.81039,-1.8125 1.8125,-1.8125 z"
id="path4294"
style="display:inline;overflow:visible;visibility:visible;opacity:0.05;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.00178742;marker:none;enable-background:accumulate"
inkscape:connector-curvature="0" />
<path
d="M 21,8.9999996 V 15 H 17.8125 L 24,22 30.1875,15 H 27 V 8.9999996 Z M 23.21875,23 c -0.172892,0 -0.28125,0.294922 -0.28125,0.65625 V 25.9375 C 22.24145,26.095996 21.585954,26.379869 21,26.75 l -1.625,-1.625 c -0.255498,-0.255497 -0.533998,-0.372253 -0.65625,-0.25 l -1.53125,1.53125 c -0.122254,0.122254 -0.0055,0.400753 0.25,0.65625 l 1.625,1.625 c -0.37013,0.585953 -0.654003,1.24145 -0.8125,1.9375 h -2.28125 c -0.361328,0 -0.65625,0.108357 -0.65625,0.28125 v 2.1875 c 0,0.172892 0.294922,0.28125 0.65625,0.28125 H 18.25 c 0.158497,0.69605 0.44237,1.351546 0.8125,1.9375 l -1.625,1.625 c -0.255497,0.255498 -0.372254,0.533997 -0.25,0.65625 l 1.53125,1.53125 c 0.122252,0.122254 0.400752,0.0055 0.65625,-0.25 L 21,37.25 c 0.585954,0.37013 1.24145,0.654002 1.9375,0.8125 v 2.28125 C 22.9375,40.705077 23.045858,41 23.21875,41 h 2.1875 c 0.172893,0 0.28125,-0.294924 0.28125,-0.65625 V 38.0625 c 0.69605,-0.158498 1.351546,-0.44237 1.9375,-0.8125 l 1.625,1.625 c 0.255498,0.255497 0.533997,0.372254 0.65625,0.25 l 1.53125,-1.53125 c 0.122254,-0.122252 0.0055,-0.400752 -0.25,-0.65625 l -1.625,-1.625 c 0.370129,-0.585954 0.654003,-1.24145 0.8125,-1.9375 h 2.28125 c 0.361329,0 0.65625,-0.108358 0.65625,-0.28125 v -2.1875 c 0,-0.172893 -0.294921,-0.28125 -0.65625,-0.28125 H 30.375 c -0.158497,-0.69605 -0.442371,-1.351547 -0.8125,-1.9375 l 1.625,-1.625 c 0.255497,-0.255497 0.372254,-0.533997 0.25,-0.65625 L 29.90625,24.875 C 29.783997,24.752745 29.505498,24.8695 29.25,25.125 L 27.625,26.75 C 27.039046,26.379869 26.38355,26.095996 25.6875,25.9375 V 23.65625 C 25.6875,23.294922 25.579143,23 25.40625,23 Z m 1.09375,6.21875 c 1.528616,0 2.78125,1.252635 2.78125,2.78125 0,1.528615 -1.252634,2.78125 -2.78125,2.78125 -1.528614,0 -2.78125,-1.252635 -2.78125,-2.78125 0,-1.528615 1.252636,-2.78125 2.78125,-2.78125 z"
id="path2317"
style="display:inline;overflow:visible;visibility:visible;fill:url(#radialGradient2985);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.00178742;marker:none;enable-background:accumulate"
inkscape:connector-curvature="0" />
<rect
width="36.999985"
height="37.000011"
rx="1.365193"
ry="1.365193"
x="5.4999981"
y="6.4999886"
id="rect6741"
style="opacity:0.4;fill:none;stroke:url(#linearGradient2982);stroke-width:0.99999976;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<path
d="M 28.926376,15.466668 24,21.177578 18.963089,15.5 H 21.5 V 9.4999996 h 5 V 15.5 l 2.426376,-0.03333 z"
id="path2777"
style="display:inline;overflow:visible;visibility:visible;fill:none;stroke:url(#linearGradient2979);stroke-width:0.99829447;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
inkscape:connector-curvature="0" />
<path
d="m 23.4375,23.46875 c -0.01166,0.05381 -0.03125,0.100205 -0.03125,0.1875 v 2.28125 a 0.48185467,0.48185467 0 0 1 -0.375,0.46875 c -0.638467,0.145384 -1.238423,0.407111 -1.78125,0.75 a 0.48185467,0.48185467 0 0 1 -0.59375,-0.0625 l -1.625,-1.625 C 18.9779,25.4154 18.9477,25.40242 18.90625,25.375 l -1.21875,1.21875 c 0.02742,0.04145 0.0404,0.07165 0.09375,0.125 l 1.625,1.625 a 0.48185467,0.48185467 0 0 1 0.0625,0.59375 c -0.342888,0.542826 -0.604615,1.142782 -0.75,1.78125 a 0.48185467,0.48185467 0 0 1 -0.46875,0.375 h -2.28125 c -0.08729,0 -0.133695,0.01959 -0.1875,0.03125 v 1.75 c 0.05381,0.01166 0.100205,0.03125 0.1875,0.03125 H 18.25 a 0.48185467,0.48185467 0 0 1 0.46875,0.375 c 0.145385,0.638468 0.407112,1.238423 0.75,1.78125 a 0.48185467,0.48185467 0 0 1 -0.0625,0.59375 l -1.625,1.625 c -0.05335,0.05335 -0.06633,0.08355 -0.09375,0.125 l 1.21875,1.21875 c 0.04145,-0.02742 0.07165,-0.0404 0.125,-0.09375 l 1.625,-1.625 A 0.48185467,0.48185467 0 0 1 21.25,36.84375 c 0.542827,0.342888 1.142781,0.604614 1.78125,0.75 a 0.48185467,0.48185467 0 0 1 0.375,0.46875 v 2.28125 c 0,0.08729 0.01959,0.133695 0.03125,0.1875 h 1.75 c 0.01166,-0.0538 0.03125,-0.100206 0.03125,-0.1875 V 38.0625 a 0.48185467,0.48185467 0 0 1 0.375,-0.46875 c 0.638469,-0.145386 1.238423,-0.407112 1.78125,-0.75 a 0.48185467,0.48185467 0 0 1 0.59375,0.0625 l 1.625,1.625 c 0.05335,0.05335 0.08355,0.06633 0.125,0.09375 l 1.21875,-1.21875 c -0.02742,-0.04145 -0.0404,-0.07165 -0.09375,-0.125 l -1.625,-1.625 a 0.48185467,0.48185467 0 0 1 -0.0625,-0.59375 c 0.342888,-0.542828 0.604615,-1.142783 0.75,-1.78125 a 0.48185467,0.48185467 0 0 1 0.46875,-0.375 h 2.28125 c 0.08729,0 0.133695,-0.01959 0.1875,-0.03125 v -1.75 c -0.0538,-0.01166 -0.100204,-0.03125 -0.1875,-0.03125 H 30.375 a 0.48185467,0.48185467 0 0 1 -0.46875,-0.375 c -0.145385,-0.638467 -0.407113,-1.238424 -0.75,-1.78125 a 0.48185467,0.48185467 0 0 1 0.0625,-0.59375 l 1.625,-1.625 c 0.05335,-0.05335 0.06633,-0.08355 0.09375,-0.125 L 29.71875,25.375 c -0.04145,0.02742 -0.07165,0.0404 -0.125,0.09375 l -1.625,1.625 a 0.48185467,0.48185467 0 0 1 -0.59375,0.0625 c -0.542827,-0.342889 -1.142783,-0.604616 -1.78125,-0.75 a 0.48185467,0.48185467 0 0 1 -0.375,-0.46875 v -2.28125 c 0,-0.0873 -0.01959,-0.133695 -0.03125,-0.1875 z m 0.875,5.28125 c 1.791829,0 3.25,1.458172 3.25,3.25 0,1.791828 -1.458171,3.25 -3.25,3.25 -1.791827,0 -3.25,-1.458172 -3.25,-3.25 0,-1.791828 1.458173,-3.25 3.25,-3.25 z"
id="path4243"
style="display:inline;overflow:visible;visibility:visible;fill:none;stroke:url(#linearGradient2975);stroke-width:1;stroke-opacity:1;marker:none;enable-background:accumulate"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -1,6 +1,7 @@
import os
from pathlib import Path
from bauh.api.constants import CACHE_PATH, HOME_PATH, CONFIG_PATH
from bauh.api.constants import CACHE_PATH, CONFIG_PATH
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
BUILD_DIR = '/tmp/bauh/aur'
@@ -8,7 +9,7 @@ ARCH_CACHE_PATH = CACHE_PATH + '/arch'
CATEGORIES_CACHE_DIR = ARCH_CACHE_PATH + '/categories'
CATEGORIES_FILE_PATH = CATEGORIES_CACHE_DIR + '/aur.txt'
URL_CATEGORIES_FILE = 'https://raw.githubusercontent.com/vinifmor/bauh-files/master/aur/categories.txt'
CONFIG_DIR = '{}/.config/bauh/arch'.format(HOME_PATH)
CONFIG_DIR = '{}/.config/bauh/arch'.format(Path.home())
CUSTOM_MAKEPKG_FILE = '{}/makepkg.conf'.format(CONFIG_DIR)
AUR_INDEX_FILE = '{}/aur.txt'.format(BUILD_DIR)
CONFIG_FILE = '{}/arch.yml'.format(CONFIG_PATH)

View File

@@ -9,7 +9,7 @@ from bauh.view.util.translation import I18n
def _get_mirror_icon(mirror: str):
return resource.get_path('img/{}.png'.format('arch' if mirror == 'aur' else 'mirror'), ROOT_DIR)
return resource.get_path('img/{}.svg'.format('arch' if mirror == 'aur' else 'mirror'), ROOT_DIR)
def request_optional_deps(pkgname: str, pkg_mirrors: dict, watcher: ProcessWatcher, i18n: I18n) -> Set[str]:

View File

@@ -61,7 +61,7 @@ class ArchPackage(SoftwarePackage):
return self.icon_path
def get_type_icon_path(self):
return resource.get_path('img/arch.png', ROOT_DIR) # TODO change icon when from mirrors
return resource.get_path('img/arch.svg', ROOT_DIR) # TODO change icon when from mirrors
def is_application(self):
return self.can_be_run()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 905 B

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
enable-background="new 0 0 515.91 728.5"
height="24.000002"
id="Layer_1"
version="1.1"
viewBox="0 0 24.000003 24.000002"
width="24.000002"
xml:space="preserve"
sodipodi:docname="arch.svg"
inkscape:version="0.92.4 5da689c313, 2019-01-14"><metadata
id="metadata1699"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1360"
inkscape:window-height="703"
id="namedview1697"
showgrid="false"
showborder="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="0.028808594"
inkscape:cx="-7209.5591"
inkscape:cy="-2410.7966"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" /><defs
id="defs7" /><g
id="g3824"
transform="matrix(0.046875,0,0,0.046875,6.9430338,6.4852622)"><path
d="m -733.62329,72.267944 c 0,203.804876 -165.21649,369.021366 -369.02141,369.021366 -203.8048,0 -369.0213,-165.21649 -369.0213,-369.021366 0,-203.804874 165.2165,-369.021364 369.0213,-369.021364 203.80492,0 369.02141,165.21649 369.02141,369.021364 z"
id="path4878"
style="fill:#1793d1;fill-opacity:1;fill-rule:nonzero;stroke:none"
transform="matrix(0.69372682,0,0,0.69372682,872.81612,67.513546)"
inkscape:connector-curvature="0" /><path
d="M 107.84949,-98.602257 C 92.493787,-60.954304 83.231987,-36.328024 66.135387,0.20085614 76.617787,11.312106 89.484387,24.251686 110.3795,38.865776 87.915087,29.621786 72.591587,20.341076 61.140187,10.710446 39.259887,56.367046 4.9797874,121.40283 -64.585822,246.39777 c 54.6762094,-31.56545 97.060109,-51.0259 136.559909,-58.45149 -1.696,-7.29506 -2.6605,-15.1861 -2.595,-23.41953 l 0.065,-1.7516 c 0.8677,-35.02952 19.09,-61.96722 40.676113,-60.13821 21.5861,1.82902 38.3647,31.72582 37.4971,66.75537 -0.1631,6.59145 -0.9065,12.93234 -2.2057,18.81346 39.0709,7.64297 81.0017,27.0536 134.93811,58.192 C 269.7144,226.81765 260.2216,209.1676 251.1563,192.3577 236.8771,181.29028 221.983,166.88599 191.602,151.29245 c 20.8822,5.42606 35.8334,11.68629 47.4876,18.68371 C 146.9204,-1.6272139 139.4566,-24.429744 107.84949,-98.602257 Z"
id="path2518"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
inkscape:connector-curvature="0" /></g></svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
enable-background="new 0 0 515.91 728.5"
height="24.000002"
id="Layer_1"
version="1.1"
viewBox="0 0 24.000003 24.000002"
width="24.000002"
xml:space="preserve"
sodipodi:docname="mirror.svg"
inkscape:version="0.92.4 5da689c313, 2019-01-14"><metadata
id="metadata1699"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1360"
inkscape:window-height="703"
id="namedview1697"
showgrid="false"
showborder="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="0.921875"
inkscape:cx="397.90313"
inkscape:cy="-179.59695"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" /><defs
id="defs7" /><g
id="g2275"><path
d="M 24.000004,12.000001 C 24.000004,18.627417 18.627422,24 12.000003,24 5.3725893,24 6.47896e-6,18.627417 6.47896e-6,12.000001 6.47896e-6,5.3725839 5.3725893,1.4169352e-6 12.000003,1.4169352e-6 18.627422,1.4169352e-6 24.000004,5.3725839 24.000004,12.000001 Z"
id="path4878"
style="fill:#2ca05a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.03251844"
inkscape:connector-curvature="0" /><path
d="M 11.998479,1.8632814 C 11.27868,3.6280292 10.844533,4.7823861 10.04313,6.4946773 10.534493,7.0155172 11.137614,7.62206 12.117073,8.307096 11.064054,7.8737834 10.345764,7.4387501 9.8089801,6.9873144 8.783341,9.127468 7.1764613,12.17602 3.9155734,18.035158 6.4785207,16.555527 8.465266,15.643319 10.316819,15.295244 c -0.0795,-0.341956 -0.124711,-0.711848 -0.12164,-1.09779 l 0.003,-0.08211 c 0.04067,-1.642008 0.894844,-2.904713 1.906693,-2.818978 1.011849,0.08573 1.798345,1.487148 1.757677,3.129158 -0.0076,0.308974 -0.04249,0.606203 -0.103392,0.881881 1.831448,0.358264 3.796954,1.268137 6.325223,2.72775 -0.49853,-0.917818 -0.943505,-1.745165 -1.368441,-2.533129 -0.669337,-0.518785 -1.367498,-1.193986 -2.791607,-1.924933 0.978853,0.254346 1.67969,0.547795 2.225981,0.875799 C 13.829928,6.4089865 13.480062,5.3401179 11.998479,1.8632814 Z"
id="path2518"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.046875"
inkscape:connector-curvature="0" /></g></svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -36,7 +36,7 @@ class FlatpakApplication(SoftwarePackage):
return 'flatpak'
def get_default_icon_path(self):
return resource.get_path('img/flathub.svg', ROOT_DIR)
return resource.get_path('img/flatpak.svg', ROOT_DIR)
def get_type_icon_path(self):
return self.get_default_icon_path()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

View File

@@ -9,13 +9,13 @@
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="47.919052"
height="48.110374"
viewBox="0 0 12.678582 12.729203"
width="24.007744"
height="23.836931"
viewBox="0 0 6.3520486 6.3068546"
version="1.1"
id="svg3871"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="flathub.svg">
inkscape:version="0.92.4 5da689c313, 2019-01-14"
sodipodi:docname="flatpak.svg">
<defs
id="defs3865" />
<sodipodi:namedview
@@ -26,16 +26,16 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
inkscape:cx="8.4698372"
inkscape:cy="118.04149"
inkscape:cx="8.3644404"
inkscape:cy="118.27981"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
showborder="false"
inkscape:window-width="1366"
inkscape:window-width="1360"
inkscape:window-height="703"
inkscape:window-x="0"
inkscape:window-y="260"
inkscape:window-y="0"
inkscape:window-maximized="1"
fit-margin-bottom="-0.2"
fit-margin-top="0"
@@ -58,9 +58,9 @@
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-12.122116,-167.33593)">
transform="translate(-12.150001,-173.82134)">
<g
transform="matrix(0.08875425,0,0,0.11490723,-57.513376,72.576168)"
transform="matrix(0.04446643,0,0,0.05717234,-22.737812,126.67341)"
id="g10674"
style="stroke-width:0.77710575">
<path

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -45,7 +45,7 @@ class SnapApplication(SoftwarePackage):
return 'snap'
def get_default_icon_path(self):
return resource.get_path('img/snap.png', ROOT_DIR)
return resource.get_path('img/snap.svg', ROOT_DIR)
def get_type_icon_path(self):
return self.get_default_icon_path()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
id="svg3957"
height="6.3499999mm"
width="6.3499999mm"
version="1.1"
viewBox="0 0 24.000124 24.000125"
sodipodi:docname="snap.svg"
inkscape:version="0.92.4 5da689c313, 2019-01-14">
<defs
id="defs83" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1360"
inkscape:window-height="703"
id="namedview81"
showgrid="false"
showborder="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="1.6803366"
inkscape:cx="192.32571"
inkscape:cy="-49.135216"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg3957" />
<metadata
id="metadata3963">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
style="fill:none"
id="snapcraft-logo--web"
transform="matrix(0.76433516,0,0,0.80000413,0,-0.40000206)">
<path
id="Combined-Shape"
d="m 18.06,7.28 6.92,3.08 -6.92,6.92 z M 4.84,30.5 l 8.49,-15.92 3.73,3.7 z M 0,0.5 17.47,6.82 v 11.05 z"
inkscape:connector-curvature="0"
style="fill:#82bfa1" />
<polygon
id="Shape"
points="18.46,6.82 31.4,12.57 28.53,6.82 "
style="fill:#fa6340" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -1,7 +1,7 @@
import os
from pathlib import Path
from bauh.api.constants import HOME_PATH, DESKTOP_ENTRIES_DIR, CONFIG_PATH
from bauh.api.constants import DESKTOP_ENTRIES_DIR, CONFIG_PATH
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
WEB_PATH = '{}/.local/share/bauh/web'.format(Path.home())
@@ -13,7 +13,7 @@ NODE_BIN_PATH = '{}/bin/node'.format(NODE_DIR_PATH)
NPM_BIN_PATH = '{}/bin/npm'.format(NODE_DIR_PATH)
NODE_MODULES_PATH = '{}/node_modules'.format(ENV_PATH)
NATIVEFIER_BIN_PATH = '{}/.bin/nativefier'.format(NODE_MODULES_PATH)
ELECTRON_PATH = '{}/.cache/electron'.format(HOME_PATH)
ELECTRON_PATH = '{}/.cache/electron'.format(Path.home())
ELECTRON_DOWNLOAD_URL = 'https://github.com/electron/electron/releases/download/v{version}/electron-v{version}-linux-{arch}.zip'
ELECTRON_SHA256_URL = 'https://github.com/electron/electron/releases/download/v{version}/SHASUMS256.txt'
URL_ENVIRONMENT_SETTINGS = 'https://raw.githubusercontent.com/vinifmor/bauh-files/master/web/environment.yml'

View File

@@ -11,6 +11,7 @@ from typing import List, Type, Set, Tuple
import yaml
from colorama import Fore
from requests import exceptions
from bauh.api.abstract.context import ApplicationContext
from bauh.api.abstract.controller import SoftwareManager, SearchResult
@@ -136,10 +137,14 @@ class WebApplicationManager(SoftwareManager):
return description
def _get_fix_for(self, url_no_protocol: str) -> str:
res = self.http_client.get(URL_FIX_PATTERN.format(url=url_no_protocol))
fix_url = URL_FIX_PATTERN.format(url=url_no_protocol)
if res:
return res.text
try:
res = self.http_client.get(fix_url, session=False)
if res:
return res.text
except Exception as e:
self.logger.warning("Error when trying to retrieve a fix for {}: {}".format(fix_url, e.__class__.__name__))
def _strip_url_protocol(self, url: str) -> str:
return RE_PROTOCOL_STRIP.split(url)[1].strip().lower()
@@ -149,10 +154,14 @@ class WebApplicationManager(SoftwareManager):
def _map_url(self, url: str) -> "BeautifulSoup":
headers = {'Accept-language': self._get_lang_header(), 'User-Agent': UA_CHROME}
url_res = self.http_client.get(url, headers=headers, ignore_ssl=True, single_call=True)
if url_res:
return BeautifulSoup(url_res.text, 'lxml', parse_only=SoupStrainer('head'))
try:
url_res = self.http_client.get(url, headers=headers, ignore_ssl=True, single_call=True, session=False)
if url_res:
return BeautifulSoup(url_res.text, 'lxml', parse_only=SoupStrainer('head'))
except exceptions.ConnectionError as e:
self.logger.warning("Could not get {}: {}".format(url, e.__class__.__name__))
def search(self, words: str, disk_loader: DiskCacheLoader, limit: int = -1, is_url: bool = False) -> SearchResult:
local_config = {}
@@ -411,7 +420,7 @@ class WebApplicationManager(SoftwareManager):
default_option=icon_op_disp if app.icon_url and app.save_icon else icon_op_ded,
label=self.i18n['web.install.option.wicon.label'])
icon_chooser = FileChooserComponent(allowed_extensions={'png', 'svg', 'ico'}, label=self.i18n['web.install.option.icon.label'])
icon_chooser = FileChooserComponent(allowed_extensions={'png', 'svg', 'ico', 'xpm'}, label=self.i18n['web.install.option.icon.label'])
form_1 = FormComponent(components=[inp_url, inp_name, inp_desc, inp_cat, inp_icon, icon_chooser, inp_tray], label=self.i18n['web.install.options.basic'].capitalize())
@@ -506,7 +515,7 @@ class WebApplicationManager(SoftwareManager):
def _ask_update_permission(self, to_update: List[EnvironmentComponent], watcher: ProcessWatcher) -> bool:
icon = resource.get_path('img/web.png', ROOT_DIR)
icon = resource.get_path('img/web.svg', ROOT_DIR)
opts = [InputOption(label='{} ( {} )'.format(f.name, f.size or '?'),
tooltip=f.url, icon_path=icon, read_only=True, value=f.name) for f in to_update]
@@ -520,11 +529,11 @@ class WebApplicationManager(SoftwareManager):
def _download_suggestion_icon(self, pkg: WebApplication, app_dir: str) -> Tuple[str, bytes]:
try:
if self.http_client.exists(pkg.icon_url):
if self.http_client.exists(pkg.icon_url, session=False):
icon_path = '{}/{}'.format(app_dir, pkg.icon_url.split('/')[-1])
try:
res = self.http_client.get(pkg.icon_url)
res = self.http_client.get(pkg.icon_url, session=False)
if not res:
self.logger.info('Could not download the icon {}'.format(pkg.icon_url))
else:
@@ -747,7 +756,7 @@ class WebApplicationManager(SoftwareManager):
if not app.description:
app.description = self._get_app_description(app.url, soup)
find_url = not app.icon_url or (app.icon_url and not self.http_client.exists(app.icon_url))
find_url = not app.icon_url or (app.icon_url and not self.http_client.exists(app.icon_url, session=False))
if find_url:
app.icon_url = self._get_app_icon_url(app.url, soup)

View File

@@ -54,7 +54,7 @@ class WebApplication(SoftwarePackage):
return self.get_default_icon_path()
def get_default_icon_path(self) -> str:
return resource.get_path('img/web.png', ROOT_DIR)
return resource.get_path('img/web.svg', ROOT_DIR)
def get_disk_data_path(self) -> str:
return '{}/data.yml'.format(self.get_disk_cache_path())

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="24"
height="24"
version="1.1"
viewBox="0 0 24 24"
id="svg2382"
sodipodi:docname="web.svg"
inkscape:version="0.92.4 5da689c313, 2019-01-14">
<metadata
id="metadata2388">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs2386" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1360"
inkscape:window-height="703"
id="namedview2384"
showgrid="false"
showborder="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="1.84375"
inkscape:cx="129.15254"
inkscape:cy="-99.812854"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg2382" />
<g
id="g2943"
transform="translate(-4,-37)">
<path
inkscape:connector-curvature="0"
id="path2362"
d="M 16,37.421053 A 12,11.789474 0 0 0 4,49.210526 12,11.789474 0 0 0 16,61 12,11.789474 0 0 0 28,49.210526 12,11.789474 0 0 0 16,37.421053 Z"
style="opacity:0.2;stroke-width:0.42479539" />
<path
inkscape:connector-curvature="0"
id="path2364"
d="M 16,37 A 12,11.789474 0 0 0 4,48.789474 12,11.789474 0 0 0 16,60.578947 12,11.789474 0 0 0 28,48.789474 12,11.789474 0 0 0 16,37 Z"
style="fill:#74bfcc;stroke-width:0.42479539" />
<path
inkscape:connector-curvature="0"
id="path2366"
d="m 22.437143,48.435789 c 0,0 1.616426,-2.123624 0.618857,-4.169263 -0.997569,-2.045638 -5.839234,-0.583175 -9.561408,1.970905 -2.679624,1.838702 -3.9702527,5.080054 -3.9231634,7.183622"
style="fill:none;stroke:#3f3f3f;stroke-width:0.84959078;stroke-linecap:round" />
<path
inkscape:connector-curvature="0"
id="path2368"
d="m 13,54.263158 c 0,0 0.61247,2.449842 3.33041,2.555789 2.71794,0.105947 3.869899,-4.414886 3.47959,-8.85887 -0.280985,-3.199262 -1.503611,-6.158885 -3.381429,-7.170603"
style="fill:none;stroke:#3f3f3f;stroke-width:0.84959078;stroke-linecap:round" />
<path
inkscape:connector-curvature="0"
id="path2370"
d="m 13.857143,43.4 c 0,0 -3.778942,-2.241926 -4.883143,0.349694 -1.104201,2.591621 2.556418,7.331573 6.938268,8.499148 3.058605,0.814988 6.490017,-0.158277 7.373446,-0.512"
style="fill:none;stroke:#3f3f3f;stroke-width:0.84959078;stroke-linecap:round" />
<ellipse
id="ellipse2372"
ry="0.89515787"
rx="0.91114283"
cy="48.36842"
cx="16.428572"
style="fill:#3f3f3f;stroke:#3f3f3f;stroke-width:0.74296564" />
<path
inkscape:connector-curvature="0"
id="path2374"
d="M 16,37 A 12,11.789474 0 0 0 4,48.789474 12,11.789474 0 0 0 4.0092076,48.960526 12,11.789474 0 0 1 16,37.421053 12,11.789474 0 0 1 27.990793,49.032895 12,11.789474 0 0 0 28,48.789474 12,11.789474 0 0 0 16,37 Z"
style="opacity:0.2;fill:#ffffff;stroke-width:0.42479539" />
<path
inkscape:connector-curvature="0"
id="path2376"
d="m 16.368304,39.52796 a 1.2857143,1.2631579 0 0 0 -1.053014,0.629935 1.2857143,1.2631579 0 0 0 0.470424,1.725329 1.2857143,1.2631579 0 0 0 1.756139,-0.462171 1.2857143,1.2631579 0 0 0 -0.470424,-1.725329 1.2857143,1.2631579 0 0 0 -0.703125,-0.167764 z m 6.887277,10.945724 a 1.2857143,1.2631579 0 0 0 -0.612724,0.169408 1.2857143,1.2631579 0 0 0 -0.470424,1.725329 1.2857143,1.2631579 0 0 0 1.756138,0.462171 1.2857143,1.2631579 0 0 0 0.470424,-1.725329 1.2857143,1.2631579 0 0 0 -1.143414,-0.631579 z M 9.5714286,52.157895 a 1.2857143,1.2631579 0 0 0 -1.2857143,1.263158 1.2857143,1.2631579 0 0 0 1.2857143,1.263158 1.2857143,1.2631579 0 0 0 1.2857144,-1.263158 1.2857143,1.2631579 0 0 0 -1.2857144,-1.263158 z"
style="fill:#3f3f3f;stroke-width:0.42479539" />
<path
inkscape:connector-curvature="0"
id="path2378"
d="M 16.428571,40.789474 A 0.42857143,0.42105263 0 0 0 16,41.210526 a 0.42857143,0.42105263 0 0 0 0.428571,0.421053 0.42857143,0.42105263 0 0 0 0.428572,-0.421053 0.42857143,0.42105263 0 0 0 -0.428572,-0.421052 z m 6.857143,10.947368 a 0.42857143,0.42105263 0 0 0 -0.428571,0.421053 0.42857143,0.42105263 0 0 0 0.428571,0.421052 0.42857143,0.42105263 0 0 0 0.428572,-0.421052 0.42857143,0.42105263 0 0 0 -0.428572,-0.421053 z M 9.5714286,53.421053 A 0.42857143,0.42105263 0 0 0 9.1428571,53.842105 0.42857143,0.42105263 0 0 0 9.5714286,54.263158 0.42857143,0.42105263 0 0 0 10,53.842105 0.42857143,0.42105263 0 0 0 9.5714286,53.421053 Z"
style="opacity:0.2;stroke-width:0.42479539" />
<path
inkscape:connector-curvature="0"
id="path2380"
d="M 16.428571,40.368421 A 0.42857143,0.42105263 0 0 0 16,40.789474 a 0.42857143,0.42105263 0 0 0 0.428571,0.421052 0.42857143,0.42105263 0 0 0 0.428572,-0.421052 0.42857143,0.42105263 0 0 0 -0.428572,-0.421053 z m 6.857143,10.947368 a 0.42857143,0.42105263 0 0 0 -0.428571,0.421053 0.42857143,0.42105263 0 0 0 0.428571,0.421053 0.42857143,0.42105263 0 0 0 0.428572,-0.421053 0.42857143,0.42105263 0 0 0 -0.428572,-0.421053 z M 9.5714286,53 A 0.42857143,0.42105263 0 0 0 9.1428571,53.421053 0.42857143,0.42105263 0 0 0 9.5714286,53.842105 0.42857143,0.42105263 0 0 0 10,53.421053 0.42857143,0.42105263 0 0 0 9.5714286,53 Z"
style="fill:#74bfcc;stroke-width:0.42479539" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@@ -19,7 +19,7 @@ class SuggestionsDownloader:
def download(self) -> dict:
self.logger.info("Reading suggestions from {}".format(URL_SUGGESTIONS))
try:
suggestions = self.http_client.get_yaml(URL_SUGGESTIONS)
suggestions = self.http_client.get_yaml(URL_SUGGESTIONS, session=False)
if suggestions:
self.logger.info("{} suggestions successfully read".format(len(suggestions)))

View File

@@ -55,7 +55,7 @@ class AboutDialog(QDialog):
gems_widget.layout().addWidget(QLabel())
for gem_path in available_gems:
icon = QLabel()
pxmap = QPixmap(gem_path + '/resources/img/{}.png'.format(gem_path.split('/')[-1]))
pxmap = QPixmap(gem_path + '/resources/img/{}.svg'.format(gem_path.split('/')[-1]))
icon.setPixmap(pxmap.scaled(24, 24, Qt.KeepAspectRatio, Qt.SmoothTransformation))
gems_widget.layout().addWidget(icon)
gems_widget.layout().addWidget(QLabel())

View File

@@ -2,7 +2,7 @@ import os
from threading import Lock
from typing import List
from PyQt5.QtCore import Qt, QUrl
from PyQt5.QtCore import Qt, QUrl, QSize
from PyQt5.QtGui import QPixmap, QIcon, QCursor
from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkRequest, QNetworkReply
from PyQt5.QtWidgets import QTableWidget, QTableView, QMenu, QAction, QTableWidgetItem, QToolButton, QWidget, \
@@ -14,6 +14,7 @@ from bauh.commons.html import strip_html
from bauh.view.qt import dialog
from bauh.view.qt.components import IconButton
from bauh.view.qt.view_model import PackageView, PackageViewStatus
from bauh.view.qt.view_utils import load_resource_icon
from bauh.view.util import resource
from bauh.view.util.translation import I18n
@@ -77,7 +78,7 @@ class AppsTable(QTableWidget):
self.setHorizontalHeaderLabels(['' for _ in range(self.columnCount())])
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.icon_logo = QIcon(resource.get_path('img/logo.svg'))
self.pixmap_verified = QPixmap(resource.get_path('img/verified.svg'))
self.pixmap_verified = QIcon(resource.get_path('img/verified.svg')).pixmap(QSize(10, 10))
self.network_man = QNetworkAccessManager()
self.network_man.finished.connect(self._load_icon_and_cache)
@@ -288,8 +289,7 @@ class AppsTable(QTableWidget):
pixmap = self.cache_type_icon.get(pkg.model.get_type())
if not pixmap:
pixmap = QPixmap(pkg.model.get_type_icon_path())
pixmap = pixmap.scaled(16, 16, Qt.KeepAspectRatio, Qt.SmoothTransformation)
pixmap = QIcon(pkg.model.get_type_icon_path()).pixmap(QSize(14,14))
self.cache_type_icon[pkg.model.get_type()] = pixmap
item = QLabel()
@@ -426,26 +426,26 @@ class AppsTable(QTableWidget):
def run():
self.window.run_app(pkg)
item.addWidget(IconButton(icon_path=resource.get_path('img/app_play.png'), action=run, background='#088A08', tooltip=self.i18n['action.run.tooltip']))
item.addWidget(IconButton(QIcon(resource.get_path('img/app_play.svg')), action=run, background='#088A08', tooltip=self.i18n['action.run.tooltip']))
if pkg.model.has_info():
def get_info():
self.window.get_app_info(pkg)
item.addWidget(IconButton(icon_path=resource.get_path('img/app_info.svg'), action=get_info, background='#2E68D3', tooltip=self.i18n['action.info.tooltip']))
item.addWidget(IconButton(QIcon(resource.get_path('img/app_info.svg')), action=get_info, background='#2E68D3', tooltip=self.i18n['action.info.tooltip']))
if pkg.model.has_screenshots():
def get_screenshots():
self.window.get_screenshots(pkg)
item.addWidget(IconButton(icon_path=resource.get_path('img/camera.svg'), action=get_screenshots, background='purple', tooltip=self.i18n['action.screenshots.tooltip']))
item.addWidget(IconButton(QIcon(resource.get_path('img/camera.svg')), action=get_screenshots, background='purple', tooltip=self.i18n['action.screenshots.tooltip']))
def handle_click():
self.show_pkg_settings(pkg)
if self.has_any_settings(pkg):
bt = IconButton(icon_path=resource.get_path('img/app_settings.svg'), action=handle_click, background='#12ABAB', tooltip=self.i18n['action.settings.tooltip'])
bt = IconButton(QIcon(resource.get_path('img/app_settings.svg')), action=handle_click, background='#12ABAB', tooltip=self.i18n['action.settings.tooltip'])
item.addWidget(bt)
self.setCellWidget(pkg.table_index, col, item)

View File

@@ -8,7 +8,7 @@ from PyQt5.QtWidgets import QRadioButton, QGroupBox, QCheckBox, QComboBox, QGrid
from bauh.api.abstract.view import SingleSelectComponent, InputOption, MultipleSelectComponent, SelectViewType, \
TextInputComponent, FormComponent, FileChooserComponent
from bauh.view.qt import css
from bauh.view.qt import css, view_utils
from bauh.view.util import resource
from bauh.view.util.translation import I18n
@@ -182,8 +182,9 @@ class MultipleSelectQt(QGroupBox):
for op in model.options: # loads the help icon if at least one option has a tooltip
if op.tooltip:
with open(resource.get_path('img/help.png'), 'rb') as f:
with open(resource.get_path('img/about.svg'), 'rb') as f:
pixmap_help.loadFromData(f.read())
pixmap_help = pixmap_help.scaled(16, 16, Qt.KeepAspectRatio, Qt.SmoothTransformation)
break
for op in model.options:
@@ -240,10 +241,10 @@ class InputFilter(QLineEdit):
class IconButton(QWidget):
def __init__(self, icon_path: str, action, background: str = None, align: int = Qt.AlignCenter, tooltip: str = None):
def __init__(self, icon: QIcon, action, background: str = None, align: int = Qt.AlignCenter, tooltip: str = None):
super(IconButton, self).__init__()
self.bt = QToolButton()
self.bt.setIcon(QIcon(icon_path))
self.bt.setIcon(icon)
self.bt.clicked.connect(action)
if background:

View File

@@ -49,7 +49,7 @@ class GemSelectorPanel(QWidget):
op = InputOption(label=i18n.get('gem.{}.label'.format(modname), modname.capitalize()),
tooltip=i18n.get('gem.{}.info'.format(modname)),
value=modname,
icon_path='{r}/gems/{n}/resources/img/{n}.png'.format(r=ROOT_DIR, n=modname))
icon_path='{r}/gems/{n}/resources/img/{n}.svg'.format(r=ROOT_DIR, n=modname))
gem_options.append(op)
self.gem_map[modname] = m

View File

@@ -1,12 +1,11 @@
import os
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QInputDialog, QLineEdit
from bauh.api.abstract.view import MessageType
from bauh.commons.system import new_subprocess
from bauh.view.qt.dialog import show_message
from bauh.view.util import resource
from bauh.view.qt.view_utils import load_resource_icon
from bauh.view.util.translation import I18n
@@ -19,7 +18,7 @@ def ask_root_password(i18n: I18n):
diag.setStyleSheet("""QLineEdit { border-radius: 5px; font-size: 16px; border: 1px solid lightblue }""")
diag.setInputMode(QInputDialog.TextInput)
diag.setTextEchoMode(QLineEdit.Password)
diag.setWindowIcon(QIcon(resource.get_path('img/lock.png')))
diag.setWindowIcon(load_resource_icon('img/lock.svg', 20, 24))
diag.setWindowTitle(i18n['popup.root.title'])
diag.setLabelText('')
diag.setOkButtonText(i18n['popup.root.continue'].capitalize())

View File

@@ -11,6 +11,7 @@ from PyQt5.QtWidgets import QSystemTrayIcon, QMenu
from bauh import __app_name__
from bauh.api.abstract.controller import SoftwareManager
from bauh.api.abstract.model import PackageUpdate
from bauh.view.qt.view_utils import load_resource_icon
from bauh.view.util import util, resource
from bauh.view.qt.about import AboutDialog
from bauh.view.qt.window import ManageWindow
@@ -47,7 +48,7 @@ class TrayIcon(QSystemTrayIcon):
self.icon_default = QIcon.fromTheme('bauh_tray_default')
if self.icon_default.isNull():
self.icon_default = QIcon(resource.get_path('img/logo.png'))
self.icon_default = load_resource_icon('img/logo.svg', 24)
if config['ui']['tray']['updates_icon']:
self.icon_updates = QIcon(config['ui']['tray']['updates_icon'])
@@ -55,7 +56,7 @@ class TrayIcon(QSystemTrayIcon):
self.icon_updates = QIcon.fromTheme('bauh_tray_updates')
if self.icon_updates.isNull():
self.icon_updates = QIcon(resource.get_path('img/logo_update.png'))
self.icon_updates = load_resource_icon('img/logo_update.svg', 24)
self.setIcon(self.icon_default)

View File

@@ -1,7 +1,13 @@
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QIcon, QPixmap
from bauh.view.util import resource
def load_icon(path: str, width: int, height: int = None) -> QIcon:
return QIcon(QPixmap(path).scaled(width, height if height else width, Qt.KeepAspectRatio, Qt.SmoothTransformation))
def load_resource_icon(path: str, width: int, height: int = None) -> QIcon:
return load_icon(resource.get_path(path), width, height)
def load_icon(path: str, size: int) -> QIcon:
pixmap = QPixmap(path)
return QIcon(pixmap.scaled(size, size, Qt.KeepAspectRatio, Qt.SmoothTransformation))

View File

@@ -8,7 +8,7 @@ from typing import List, Type, Set
from PyQt5.QtCore import QEvent, Qt, QSize, pyqtSignal
from PyQt5.QtGui import QIcon, QWindowStateChangeEvent, QPixmap, QCursor
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QCheckBox, QHeaderView, QToolBar, \
QLabel, QPlainTextEdit, QLineEdit, QProgressBar, QPushButton, QComboBox, QMenu, QAction, QApplication
QLabel, QPlainTextEdit, QLineEdit, QProgressBar, QPushButton, QComboBox, QMenu, QAction, QApplication, QListView
from bauh.api.abstract.cache import MemoryCache
from bauh.api.abstract.context import ApplicationContext
@@ -33,7 +33,7 @@ from bauh.view.qt.thread import UpdateSelectedApps, RefreshApps, UninstallApp, D
GetAppHistory, SearchPackages, InstallPackage, AnimateProgress, VerifyModels, FindSuggestions, ListWarnings, \
AsyncAction, LaunchApp, ApplyFilters, CustomAction, GetScreenshots
from bauh.view.qt.view_model import PackageView
from bauh.view.qt.view_utils import load_icon
from bauh.view.qt.view_utils import load_icon, load_resource_icon
from bauh.view.util import util, resource
from bauh.view.util.translation import I18n
@@ -118,7 +118,8 @@ class ManageWindow(QWidget):
self.toolbar_search.addWidget(self.input_search)
label_pos_search = QLabel()
label_pos_search.setPixmap(QPixmap(resource.get_path('img/search.svg')))
# label_pos_search.setPixmap(QPixmap(resource.get_path('img/search.svg')))
label_pos_search.setPixmap(QIcon(resource.get_path('img/search.svg')).pixmap(QSize(10,10)))
label_pos_search.setStyleSheet("""
background: white; padding-right: 10px;
border-top-right-radius: 5px;
@@ -151,13 +152,15 @@ class ManageWindow(QWidget):
self.any_type_filter = 'any'
self.cache_type_filter_icons = {}
self.combo_filter_type = QComboBox()
self.combo_filter_type.setView(QListView())
self.combo_filter_type.setStyleSheet('QLineEdit { height: 2px; }')
self.combo_filter_type.setSizeAdjustPolicy(QComboBox.AdjustToContents)
self.combo_filter_type.setEditable(True)
self.combo_filter_type.lineEdit().setReadOnly(True)
self.combo_filter_type.lineEdit().setAlignment(Qt.AlignCenter)
self.combo_filter_type.setIconSize(QSize(14,14))
self.combo_filter_type.activated.connect(self._handle_type_filter)
self.combo_filter_type.addItem(load_icon(resource.get_path('img/logo.svg'), 14), self.i18n['type'].capitalize(), self.any_type_filter)
self.combo_filter_type.addItem('--- {} ---'.format(self.i18n['type'].capitalize()), self.any_type_filter)
self.ref_combo_filter_type = self.toolbar.addWidget(self.combo_filter_type)
self.any_category_filter = 'any'
@@ -185,7 +188,7 @@ class ManageWindow(QWidget):
self.bt_installed = QPushButton()
self.bt_installed.setToolTip(self.i18n['manage_window.bt.installed.tooltip'])
self.bt_installed.setIcon(QIcon(resource.get_path('img/disk.png')))
self.bt_installed.setIcon(QIcon(resource.get_path('img/disk.svg')))
self.bt_installed.setText(self.i18n['manage_window.bt.installed.text'].capitalize())
self.bt_installed.clicked.connect(self._show_installed)
self.bt_installed.setStyleSheet(toolbar_button_style('#A94E0A'))
@@ -318,7 +321,7 @@ class ManageWindow(QWidget):
self.combo_styles.setStyleSheet('QComboBox {font-size: 12px;}')
self.ref_combo_styles = self.toolbar_bottom.addWidget(self.combo_styles)
bt_settings = IconButton(icon_path=resource.get_path('img/app_settings.svg'),
bt_settings = IconButton(QIcon(resource.get_path('img/app_settings.svg')),
action=self._show_settings_menu,
background='#12ABAB',
tooltip=self.i18n['manage_window.bt_settings.tooltip'])
@@ -777,7 +780,7 @@ class ManageWindow(QWidget):
icon = self.cache_type_filter_icons.get(app_type)
if not icon:
icon = load_icon(icon_path, 14)
icon = QIcon(icon_path)
self.cache_type_filter_icons[app_type] = icon
self.combo_filter_type.addItem(icon, app_type.capitalize(), app_type)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 283 B

View File

@@ -0,0 +1,156 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 24 24"
xml:space="preserve"
sodipodi:docname="app_play_s.svg"
width="24"
height="24"
inkscape:version="0.92.4 5da689c313, 2019-01-14"><metadata
id="metadata856"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs854" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="3840"
inkscape:window-height="2051"
id="namedview852"
showgrid="false"
showborder="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="34.0625"
inkscape:cx="-8.9291475"
inkscape:cy="7.3386416"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1"
showguides="true"
inkscape:guide-bbox="true"><sodipodi:guide
position="-31.324771,24.014679"
orientation="0,1"
id="guide829"
inkscape:locked="false" /><sodipodi:guide
position="-31.706423,0"
orientation="0,1"
id="guide831"
inkscape:locked="false" /><sodipodi:guide
position="0,27.126606"
orientation="1,0"
id="guide833"
inkscape:locked="false" /><sodipodi:guide
position="16,22.957798"
orientation="1,0"
id="guide835"
inkscape:locked="false" /><sodipodi:guide
position="1.5559633,26.979817"
orientation="1,0"
id="guide947"
inkscape:locked="false" /><sodipodi:guide
position="-6.4587157,1.9963303"
orientation="0,1"
id="guide949"
inkscape:locked="false" /><sodipodi:guide
position="-12.770642,21.959633"
orientation="0,1"
id="guide951"
inkscape:locked="false" /><sodipodi:guide
position="24.044037,29.240367"
orientation="1,0"
id="guide836"
inkscape:locked="false" /></sodipodi:namedview>
<g
id="g819"
transform="matrix(0.03104434,0,0,0.03104584,0.64059904,4.1014743)"
style="fill:#ffffff;stroke:#333333">
<path
style="fill:#ffffff;stroke:#333333"
d="M 557.49784,206.99848 C 556.02332,209.32745 299.06055,50.553292 184.31451,-1.6920377 154.70662,-15.172888 152.32141,8.7631987 152.154,44.419264 c -0.8137,173.309056 -0.17793,416.751146 0,425.492356 0.73587,36.15214 -4.3986,60.9816 32.16051,42.58838 96.93285,-48.76779 383.3103,-210.32654 375.2762,-204.82682 68.97152,-41.77019 82.39599,-46.93515 -2.09287,-100.6747 z"
id="path817"
inkscape:connector-curvature="0"
sodipodi:nodetypes="csssscc" />
</g>
<g
id="g821"
transform="translate(-152.62981,-488.02344)">
</g>
<g
id="g823"
transform="translate(-152.62981,-488.02344)">
</g>
<g
id="g825"
transform="translate(-152.62981,-488.02344)">
</g>
<g
id="g827"
transform="translate(-152.62981,-488.02344)">
</g>
<g
id="g829"
transform="translate(-152.62981,-488.02344)">
</g>
<g
id="g831"
transform="translate(-152.62981,-488.02344)">
</g>
<g
id="g833"
transform="translate(-152.62981,-488.02344)">
</g>
<g
id="g835"
transform="translate(-152.62981,-488.02344)">
</g>
<g
id="g837"
transform="translate(-152.62981,-488.02344)">
</g>
<g
id="g839"
transform="translate(-152.62981,-488.02344)">
</g>
<g
id="g841"
transform="translate(-152.62981,-488.02344)">
</g>
<g
id="g843"
transform="translate(-152.62981,-488.02344)">
</g>
<g
id="g845"
transform="translate(-152.62981,-488.02344)">
</g>
<g
id="g847"
transform="translate(-152.62981,-488.02344)">
</g>
<g
id="g849"
transform="translate(-152.62981,-488.02344)">
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 820 B

View File

@@ -13,13 +13,12 @@
id="Capa_1"
x="0px"
y="0px"
viewBox="0 0 24 24"
viewBox="0 0 24.000261 23.700262"
xml:space="preserve"
sodipodi:docname="disc_2.svg"
width="24"
height="24"
sodipodi:docname="disc.svg"
width="24.000261"
height="23.700262"
inkscape:version="0.92.4 5da689c313, 2019-01-14"
inkscape:export-filename="/home/vinicius.moreira/shared_vb/disk_2.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"><metadata
id="metadata858"><rdf:RDF><cc:Work
@@ -38,88 +37,90 @@
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="739"
inkscape:window-width="1360"
inkscape:window-height="644"
id="namedview854"
showgrid="false"
showborder="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
fit-margin-bottom="-0.3"
inkscape:zoom="4.5416668"
inkscape:cx="55.143096"
inkscape:cy="1.6145437"
inkscape:cx="55.143227"
inkscape:cy="1.3146742"
inkscape:window-x="0"
inkscape:window-y="432"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" />
<g
id="g823"
transform="translate(-8.9954491,-22.380699)">
transform="translate(-8.9953185,-22.380568)">
</g>
<g
id="g825"
transform="translate(-8.9954491,-22.380699)">
transform="translate(-8.9953185,-22.380568)">
</g>
<g
id="g827"
transform="translate(-8.9954491,-22.380699)">
transform="translate(-8.9953185,-22.380568)">
</g>
<g
id="g829"
transform="translate(-8.9954491,-22.380699)">
transform="translate(-8.9953185,-22.380568)">
</g>
<g
id="g831"
transform="translate(-8.9954491,-22.380699)">
transform="translate(-8.9953185,-22.380568)">
</g>
<g
id="g833"
transform="translate(-8.9954491,-22.380699)">
transform="translate(-8.9953185,-22.380568)">
</g>
<g
id="g835"
transform="translate(-8.9954491,-22.380699)">
transform="translate(-8.9953185,-22.380568)">
</g>
<g
id="g837"
transform="translate(-8.9954491,-22.380699)">
transform="translate(-8.9953185,-22.380568)">
</g>
<g
id="g839"
transform="translate(-8.9954491,-22.380699)">
transform="translate(-8.9953185,-22.380568)">
</g>
<g
id="g841"
transform="translate(-8.9954491,-22.380699)">
transform="translate(-8.9953185,-22.380568)">
</g>
<g
id="g843"
transform="translate(-8.9954491,-22.380699)">
transform="translate(-8.9953185,-22.380568)">
</g>
<g
id="g845"
transform="translate(-8.9954491,-22.380699)">
transform="translate(-8.9953185,-22.380568)">
</g>
<g
id="g847"
transform="translate(-8.9954491,-22.380699)">
transform="translate(-8.9953185,-22.380568)">
</g>
<g
id="g849"
transform="translate(-8.9954491,-22.380699)">
transform="translate(-8.9953185,-22.380568)">
</g>
<g
id="g851"
transform="translate(-8.9954491,-22.380699)">
transform="translate(-8.9953185,-22.380568)">
</g>
<g
id="g1005"><path
id="g1005"
transform="translate(1.3061933e-4,1.3061933e-4)"><path
id="path920"
d="M 12 0.27929688 A 11.720572 11.720572 0 0 0 0.27929688 12 A 11.720572 11.720572 0 0 0 12 23.720703 A 11.720572 11.720572 0 0 0 23.720703 12 A 11.720572 11.720572 0 0 0 12 0.27929688 z M 12 8.59375 A 3.4069197 3.4069195 0 0 1 15.40625 12 A 3.4069197 3.4069195 0 0 1 12 15.40625 A 3.4069197 3.4069195 0 0 1 8.59375 12 A 3.4069197 3.4069195 0 0 1 12 8.59375 z "
style="fill:#ffffff;stroke:#cccccc;stroke-width:0.558855;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.94117647" /><ellipse
d="M 12,0.27929688 A 11.720572,11.720572 0 0 0 0.27929688,12 11.720572,11.720572 0 0 0 12,23.720703 11.720572,11.720572 0 0 0 23.720703,12 11.720572,11.720572 0 0 0 12,0.27929688 Z M 12,8.59375 A 3.4069197,3.4069195 0 0 1 15.40625,12 3.4069197,3.4069195 0 0 1 12,15.40625 3.4069197,3.4069195 0 0 1 8.59375,12 3.4069197,3.4069195 0 0 1 12,8.59375 Z"
style="fill:#ffffff;stroke:#cccccc;stroke-width:0.558855;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.94117647"
inkscape:connector-curvature="0" /><ellipse
cy="12"
cx="12"
id="ellipse998"

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 782 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 519 B

View File

@@ -0,0 +1,127 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
viewBox="0 0 20 24"
xml:space="preserve"
sodipodi:docname="lock.svg"
width="20"
height="24"
inkscape:version="0.92.4 5da689c313, 2019-01-14"><metadata
id="metadata937"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs935">
</defs><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1360"
inkscape:window-height="703"
id="namedview933"
showgrid="false"
showborder="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="0.90509668"
inkscape:cx="-149.6013"
inkscape:cy="29.679244"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" />
<path
style="fill:#ffffff;stroke:#ffffff;stroke-width:0.47244796"
inkscape:connector-curvature="0"
id="path939"
d="M 19.221328,9.0590556 H 17.594031 V 7.0984108 c 0,-3.7838458 -3.406592,-6.86218682 -7.5940312,-6.86218682 -4.1874394,0 -7.5940309,3.07834102 -7.5940309,6.86218682 V 9.0590556 H 0.77867292 c -0.29982928,0 -0.54244894,0.2192386 -0.54244894,0.4901724 v 12.25395 c 0,1.081301 0.97307212,1.960598 2.16974492,1.960598 H 17.594081 c 1.196623,0 2.169695,-0.879297 2.169695,-1.960645 V 9.549228 c 0,-0.2709338 -0.24262,-0.4901724 -0.542448,-0.4901724 z M 11.624143,19.298274 c 0.01694,0.138316 -0.03229,0.277138 -0.135066,0.381037 -0.102774,0.103851 -0.250044,0.163222 -0.404179,0.163222 H 8.9151528 c -0.1541362,0 -0.301406,-0.05937 -0.4041797,-0.163222 C 8.4081996,19.575458 8.3589226,19.436637 8.3759075,19.298274 L 8.718097,16.517704 C 8.1624267,16.152475 7.8303058,15.574718 7.8303058,14.940945 c 0,-1.081303 0.9730724,-1.960646 2.1697452,-1.960646 1.196672,0 2.169744,0.879297 2.169744,1.960646 0,0.633773 -0.33212,1.21153 -0.887792,1.576759 z M 14.339439,9.0590556 H 5.6605606 V 7.0984108 c 0,-2.1621453 1.946704,-3.9212433 4.3394392,-3.9212433 2.3927352,0 4.3394392,1.759098 4.3394392,3.9212433 z" /><path
d="M 19.221328,9.0590556 H 17.594031 V 7.0984108 c 0,-3.7838458 -3.406592,-6.86218682 -7.5940312,-6.86218682 -4.1874394,0 -7.5940309,3.07834102 -7.5940309,6.86218682 V 9.0590556 H 0.77867292 c -0.29982928,0 -0.54244894,0.2192386 -0.54244894,0.4901724 v 12.25395 c 0,1.081301 0.97307212,1.960598 2.16974492,1.960598 H 17.594081 c 1.196623,0 2.169695,-0.879297 2.169695,-1.960645 V 9.549228 c 0,-0.2709338 -0.24262,-0.4901724 -0.542448,-0.4901724 z M 11.624143,19.298274 c 0.01694,0.138316 -0.03229,0.277138 -0.135066,0.381037 -0.102774,0.103851 -0.250044,0.163222 -0.404179,0.163222 H 8.9151528 c -0.1541362,0 -0.301406,-0.05937 -0.4041797,-0.163222 C 8.4081996,19.575458 8.3589226,19.436637 8.3759075,19.298274 L 8.718097,16.517704 C 8.1624267,16.152475 7.8303058,15.574718 7.8303058,14.940945 c 0,-1.081303 0.9730724,-1.960646 2.1697452,-1.960646 1.196672,0 2.169744,0.879297 2.169744,1.960646 0,0.633773 -0.33212,1.21153 -0.887792,1.576759 z M 14.339439,9.0590556 H 5.6605606 V 7.0984108 c 0,-2.1621453 1.946704,-3.9212433 4.3394392,-3.9212433 2.3927352,0 4.3394392,1.759098 4.3394392,3.9212433 z"
id="path896"
inkscape:connector-curvature="0"
style="fill:#ffffff;stroke:#ffffff;stroke-width:0.04834057" />
<g
id="g902"
transform="translate(-236.96506,-257.22244)">
</g>
<g
id="g904"
transform="translate(-236.96506,-257.22244)">
</g>
<g
id="g906"
transform="translate(-236.96506,-257.22244)">
</g>
<g
id="g908"
transform="translate(-236.96506,-257.22244)">
</g>
<g
id="g910"
transform="translate(-236.96506,-257.22244)">
</g>
<g
id="g912"
transform="translate(-236.96506,-257.22244)">
</g>
<g
id="g914"
transform="translate(-236.96506,-257.22244)">
</g>
<g
id="g916"
transform="translate(-236.96506,-257.22244)">
</g>
<g
id="g918"
transform="translate(-236.96506,-257.22244)">
</g>
<g
id="g920"
transform="translate(-236.96506,-257.22244)">
</g>
<g
id="g922"
transform="translate(-236.96506,-257.22244)">
</g>
<g
id="g924"
transform="translate(-236.96506,-257.22244)">
</g>
<g
id="g926"
transform="translate(-236.96506,-257.22244)">
</g>
<g
id="g928"
transform="translate(-236.96506,-257.22244)">
</g>
<g
id="g930"
transform="translate(-236.96506,-257.22244)">
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -171,4 +171,5 @@ files=Dateien
all_files=Alle Dateien
file_chooser.title=Dateiauswahl
message.file.not_exist=Datei existiert nicht
message.file.not_exist.body=Die Datei {} scheint nicht zu existieren
message.file.not_exist.body=Die Datei {} scheint nicht zu existieren
development=Entwicklung

View File

@@ -175,4 +175,5 @@ files=files
all_files=all files
file_chooser.title=File selector
message.file.not_exist=File does not exist
message.file.not_exist.body=The file {} seems not to exist
message.file.not_exist.body=The file {} seems not to exist
development=development

View File

@@ -172,4 +172,5 @@ files=files
all_files=tutti i files
file_chooser.title=Selettore file
message.file.not_exist=File non esiste
message.file.not_exist.body=Il file {} sembra non esistere
message.file.not_exist.body=Il file {} sembra non esistere
development=sviluppo

View File

@@ -19,7 +19,10 @@ class I18n(dict):
return self.current.__getitem__(item)
except KeyError:
if self.default:
return self.default.__getitem__(item)
try:
return self.default.__getitem__(item)
except KeyError:
return item
else:
return item