From 45017bb0df46af233d46d318bbf7403d30aa2615 Mon Sep 17 00:00:00 2001 From: Bezleputh Date: Sat, 4 Jun 2016 20:54:57 +0200 Subject: [PATCH] [boobank_indicator] Do not include load account type in total --- contrib/boobank_indicator/MANIFEST.in | 2 ++ .../boobank_indicator/boobank_indicator.py | 13 ++++++++----- .../boobank_indicator/data/personal-loan.png | Bin 0 -> 1651 bytes contrib/boobank_indicator/setup.py | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) create mode 100755 contrib/boobank_indicator/boobank_indicator/data/personal-loan.png diff --git a/contrib/boobank_indicator/MANIFEST.in b/contrib/boobank_indicator/MANIFEST.in index c34622e253..a7c8ea703b 100644 --- a/contrib/boobank_indicator/MANIFEST.in +++ b/contrib/boobank_indicator/MANIFEST.in @@ -1,4 +1,6 @@ include boobank-indicator/data/indicator-boobank.png include boobank-indicator/data/green_light.png include boobank-indicator/data/red_light.png +include boobank-indicator/data/red_light.png +include boobank-indicator/data/personal-loan.png exclude screenshot.png \ No newline at end of file diff --git a/contrib/boobank_indicator/boobank_indicator/boobank_indicator.py b/contrib/boobank_indicator/boobank_indicator/boobank_indicator.py index fd1fe5415b..4557fcdf05 100644 --- a/contrib/boobank_indicator/boobank_indicator/boobank_indicator.py +++ b/contrib/boobank_indicator/boobank_indicator/boobank_indicator.py @@ -11,7 +11,7 @@ from gi.repository import AppIndicator3 as appindicator from weboob.core import Weboob, CallErrors -from weboob.capabilities.bank import CapBank +from weboob.capabilities.bank import CapBank, Account from weboob.capabilities import UserError from weboob.tools.application.base import MoreResultsAvailable from weboob.exceptions import BrowserUnavailable, BrowserIncorrectPassword, BrowserForbidden, BrowserSSLError @@ -42,7 +42,7 @@ def run(self): account_history_menu = Gtk.Menu() for tr in self.weboob.do('iter_history', self.account, backends=self.account.backend): - label = "%s - %s: %s%s" % (tr.date, tr.label, tr.amount, self.account.currency_text) + label = u'%s - %s: %s%s' % (tr.date, tr.label, tr.amount, self.account.currency_text) image = "green_light.png" if tr.amount > 0 else "red_light.png" transaction_item = create_image_menu_item(label, image) account_history_menu.append(transaction_item) @@ -91,11 +91,14 @@ def check_boobank(self): if account.coming: balance += account.coming - total += balance - currency = account.currency_text + if account.type != Account.TYPE_LOAN: + total += balance + image = "green_light.png" if balance > 0 else "red_light.png" + else: + image = "personal-loan.png" + currency = account.currency_text label = "%s: %s%s" % (account.label, balance, account.currency_text) - image = "green_light.png" if balance > 0 else "red_light.png" account_item = create_image_menu_item(label, image) thread = BoobankTransactionsChecker(self.weboob, account_item, account) thread.start() diff --git a/contrib/boobank_indicator/boobank_indicator/data/personal-loan.png b/contrib/boobank_indicator/boobank_indicator/data/personal-loan.png new file mode 100755 index 0000000000000000000000000000000000000000..dd2f13d639e106484bfd9838231753fd251e8844 GIT binary patch literal 1651 zcmaJ?dr;GM9FL&r7;N5PoHFJ@&@mltlQeDG*aB^nO4R~F2Z(zRnm}{VrY6A_j_uSx zbmH(-n8V?z^9jdJwmA@z-)hv^cPCuQ?Rl8+Wxz{K!{ENFAn#cUQ! zGv!OaV+{Zh`UU66lk)5f2`BGX(g7Q#-|dyr0ANV*dueA0D}jYyd1v5t1QFhGPgTj$07~$6y?VwK@dR;S@%iVXX#LqZXJn1v#FE)nJI)jOsB| zgUK9}#*AtyGo_~x6Q#52a4d+mc|?i!IN6{sC+m)3)z8Ed7J;QDUU2YyX|SO(UA)AL zF5U}TvNd2X=V5rC7^t-zksK?@3fwZ5u?oB!98EjHJw+YYk+7B0TeKP+qc8-~Q&u|1JOsS!^Rs4*!LY9HS@J6kX&dVsA`5me^(8 zQQX&4-m{ zRBawU(pJt7h3k7uwU#7bDo|T}E4nUp|6TvzH?I!Gb!-$aT-Kyc-q(>A zy6SpjLBEe_N5FO5A)SJ)?QT;|oyje8+oIQ2*EjGbw<%0FZ0 zg<+>`hRn7zsVx`p-5r5e4K()O8RlyzRPRjesU(HZe%*4drpJYWjUjAX|6bs{c4~;o zzMV3;cdM=^=44yguI=6B$2V17@z$-t&J7v&CcS#4q7nylH_*q2l11*;vet-(kZltZ z=MGwx!p4g=->&-U0rRHo$h*V4m#_G;ljuA%aQ1gc(~l232j7pcI%i$8qpQDEt4al; zBfdVgTAjPDplf>cEF-^X_&|PjRYq^xB<|oWe*OJ=Rm-uQx!R(|FOM{YUg?;nF1q?wX&-$!&CHdD=CJ)+9QMn}Z~1FBq;+w@jO>_;6byPJ5&hF4HU)X4RMwKKa# zW_$H*GOo3(dN6O#)#C?~@6EVYJy`SNN&W2`M%^b5+dB)9CdVAZFCpJt{R{tK$=18f pzw1jDoND{0f8L|_9=S&njsnSUZcFxSOkLnNV58E>eddCd{{bU;WMKdR literal 0 HcmV?d00001 diff --git a/contrib/boobank_indicator/setup.py b/contrib/boobank_indicator/setup.py index 563959d608..8cc6e229ad 100644 --- a/contrib/boobank_indicator/setup.py +++ b/contrib/boobank_indicator/setup.py @@ -12,7 +12,7 @@ author_email='bezleputh@gmail.com', packages=find_packages(), package_data={ - 'boobank_indicator.data': ['indicator-boobank.png', 'green_light.png', 'red_light.png'] + 'boobank_indicator.data': ['indicator-boobank.png', 'green_light.png', 'red_light.png', 'personal-loan.png'] }, entry_points={ 'console_scripts': ['boobank_indicator = boobank_indicator.boobank_indicator:main'], -- GitLab