From 05d061fe0a25dc8032ef0954f0535a939ec467fa Mon Sep 17 00:00:00 2001 From: navjot Date: Mon, 9 Mar 2020 13:24:10 +0530 Subject: [PATCH 1/8] worked on payment screen UI or qr code scanner feature --- src/bitmessagekivy/kv/composer.kv | 52 +++++++++++++-------- src/bitmessagekivy/kv/payment.kv | 6 +++ src/bitmessagekivy/kv/payment_method.kv | 57 ++++++++++++++++++++++++ src/bitmessagekivy/main.kv | 17 ++++--- src/bitmessagekivy/mpybit.py | 42 +++++++++++++---- src/images/paymode/111.webp | Bin 0 -> 11484 bytes src/images/paymode/bitcoin-logo.jpg | Bin 0 -> 8457 bytes src/images/paymode/download.png | Bin 0 -> 5678 bytes 8 files changed, 141 insertions(+), 33 deletions(-) create mode 100644 src/bitmessagekivy/kv/payment_method.kv create mode 100644 src/images/paymode/111.webp create mode 100644 src/images/paymode/bitcoin-logo.jpg create mode 100644 src/images/paymode/download.png diff --git a/src/bitmessagekivy/kv/composer.kv b/src/bitmessagekivy/kv/composer.kv index 25a47e3d..e108cb1d 100644 --- a/src/bitmessagekivy/kv/composer.kv +++ b/src/bitmessagekivy/kv/composer.kv @@ -13,7 +13,7 @@ hint_text: 'type or select sender address' size_hint_y: None height: 100 - font_size: '13sp' + font_size: '15sp' multiline: False required: True helper_text_mode: "on_error" @@ -26,34 +26,41 @@ background_color: app.theme_cls.primary_dark values: app.variable_1 on_text: root.auto_fill_fromaddr() if self.text != 'Select' else '' - option_cls: Factory.get("MySpinnerOption") + option_cls: Factory.get("ComposerSpinnerOption") #background_color: color_button if self.state == 'normal' else color_button_pressed #background_down: 'atlas://data/images/defaulttheme/spinner' background_normal: '' background_color: app.theme_cls.primary_color color: color_font - font_size: '12.5sp' + font_size: '13.5sp' ArrowImg: BoxLayout: - orientation: 'vertical' - txt_input: txt_input - rv: rv - size : (890, 60) - MyTextInput: - id: txt_input - size_hint_y: None - font_size: '13sp' - height: self.parent.height/2 - hint_text: 'type, select or scan QR code for recipients address' - RV: - id: rv + orientation: 'horizontal' + BoxLayout: + orientation: 'vertical' + txt_input: txt_input + rv: rv + size : (890, 60) + MyTextInput: + id: txt_input + size_hint_y: None + font_size: '15sp' + height: self.parent.height/2 + # hint_text: 'type, select or scan QR code for recipients address' + RV: + id: rv + MDIconButton: + icon: 'qrcode-scan' + pos_hint: {'center_x': 0, 'center_y': .8} + on_press: root.qrScanner() + MyMDTextField: id: subject hint_text: 'subject' required: True height: 100 - font_size: '13sp' + font_size: '15sp' size_hint_y: None multiline: False helper_text_mode: "on_error" @@ -63,7 +70,7 @@ multiline: True hint_text: 'body' size_hint_y: None - font_size: '13sp' + font_size: '15sp' required: True helper_text_mode: "on_error" BoxLayout: @@ -106,4 +113,13 @@ : canvas.before: Color: - rgba: (0,0,0,1) \ No newline at end of file + rgba: (0,0,0,1) + + +: + font_size: '13.5sp' + #background_color: color_button if self.state == 'down' else color_button_pressed + #background_down: 'atlas://data/images/defaulttheme/button' + background_normal: 'atlas://data/images/defaulttheme/textinput_active' + background_color: app.theme_cls.primary_color + color: color_font \ No newline at end of file diff --git a/src/bitmessagekivy/kv/payment.kv b/src/bitmessagekivy/kv/payment.kv index 2398817f..0d14e2ca 100644 --- a/src/bitmessagekivy/kv/payment.kv +++ b/src/bitmessagekivy/kv/payment.kv @@ -78,6 +78,7 @@ halign: 'center' color: 1,1,1,1 MDLabel: + id: py2 font_style: 'H5' theme_text_color: 'Primary' text: '€ 100.0' @@ -92,6 +93,8 @@ size: self.size size: dp(app.window_size[0] - 2*self.parent.parent.padding[0]) - 10 , 1 height: dp(40) + on_press: app.root.ids.scr_mngr.current = 'pay-options' + on_press: root.move_to_pay_option(py2.text) MDLabel: font_style: 'H6' text: 'Get Monthly Credits' @@ -122,6 +125,7 @@ halign: 'center' color: 1,1,1,1 MDLabel: + id: py3 font_style: 'H5' theme_text_color: 'Primary' text: '€ 500.0' @@ -136,6 +140,8 @@ size: self.size size: dp(app.window_size[0] - 2*self.parent.parent.padding[0]) - 10 , 1 height: dp(40) + on_press: app.root.ids.scr_mngr.current = 'pay-options' + on_press: root.move_to_pay_option(py3.text) MDLabel: font_style: 'H6' text: 'Get Yearly Credits' diff --git a/src/bitmessagekivy/kv/payment_method.kv b/src/bitmessagekivy/kv/payment_method.kv new file mode 100644 index 00000000..f304d00c --- /dev/null +++ b/src/bitmessagekivy/kv/payment_method.kv @@ -0,0 +1,57 @@ +: + name: 'pay-options' + ScrollView: + do_scroll_x: False + BoxLayout: + # canvas.before: + # Color: + # rgba: .5,.5,.5,.5 + # Rectangle: + # pos: self.pos + # size: self.size + orientation: 'vertical' + padding: [self.width/4, 20, self.width/4, 20] + size_hint_y: None + spacing: 20 + height: self.minimum_height + # GridLayout: + # cols: 1 + # rows: 3 + # size_hint_y: None + # # height: self.minimum_height + # # padding: dp(10), dp(10) + # spacing: dp(10) + SmartTileWithLabel: + # size_hint_y: None + size_hint: (None, None) + # pos_hint: {'x': .5, 'y': .5} + height: 180 + width: 400 + id: tile_2 + mipmap: True + source: './images/paymode/download.png' + # text: "[size=12]Paypal[/size]" + on_press: root.redirect_on_web(self) + font_style: 'Subtitle1' + SmartTileWithLabel: + # size_hint_y: None + size_hint: (None, None) + height: 180 + width: 400 + id: tile_2 + mipmap: True + # text: "[size=12]Crypto wallet[/size]" + font_style: 'Subtitle1' + source: './images/paymode/bitcoin-logo.jpg' + on_press: root.redirect_on_web(self) + SmartTileWithLabel: + # size_hint_y: None + size_hint: (None, None) + height: 180 + width: 400 + id: tile_2 + mipmap: True + # text: "[size=12]Googgle in app[/size]" + font_style: 'Subtitle1' + source: './images/paymode/111.webp' + on_press: root.redirect_on_web(self) \ No newline at end of file diff --git a/src/bitmessagekivy/main.kv b/src/bitmessagekivy/main.kv index c507eb49..92889b31 100644 --- a/src/bitmessagekivy/main.kv +++ b/src/bitmessagekivy/main.kv @@ -27,7 +27,8 @@ #background_color: color_button if self.state == 'down' else color_button_pressed #background_down: 'atlas://data/images/defaulttheme/button' background_normal: 'atlas://data/images/defaulttheme/textinput_active' - background_color: app.theme_cls.primary_color + background_color: app.theme_cls.primary_color + # text_autoupdate: True color: color_font @@ -101,7 +102,7 @@ id: btn pos_hint:{"x":0,"y":0} option_cls: Factory.get("MySpinnerOption") - font_size: '10.9sp' + font_size: '12.5sp' text: app.getDefaultAccData() #background_color: color_button if self.state == 'normal' else color_button_pressed #background_down: 'atlas://data/images/defaulttheme/spinner' @@ -111,11 +112,11 @@ #background_color: (0.62,0.67,0.72,1) values: app.variable_1 on_text:app.getCurrentAccountData(self.text) - Image: - source: app.get_default_image() - x: self.width/6 - y: self.parent.y + self.parent.height/4 - size: self.parent.height/2, self.parent.height/2 + # Image: + # source: app.get_default_image() + # x: self.width/6 + # y: self.parent.y + self.parent.height/4 + # size: self.parent.height/2, self.parent.height/2 ArrowImg: NavigationItem: id: inbox_cnt @@ -258,6 +259,8 @@ NavigationLayout: id:sc19 Archieve: id:sc20 + PaymentMethods: + id:sc21 MDNavigationDrawer: id: nav_drawer diff --git a/src/bitmessagekivy/mpybit.py b/src/bitmessagekivy/mpybit.py index a97eecc4..97a7fa89 100644 --- a/src/bitmessagekivy/mpybit.py +++ b/src/bitmessagekivy/mpybit.py @@ -73,7 +73,8 @@ KVFILES = [ 'settings', 'popup', 'allmails', 'draft', 'maildetail', 'common_widgets', 'addressbook', 'myaddress', 'composer', 'payment', 'sent', - 'network', 'login', 'credits', 'trash', 'inbox' + 'network', 'login', 'credits', 'trash', 'inbox', + 'payment_method' ] @@ -818,6 +819,10 @@ class DropDownWidget(BoxLayout): self.ids.ti.text = self.ids.btn.text self.ids.ti.focus = True + def qrScanner(self): + """This method is used for scanning Qr code""" + pass + class MyTextInput(TextInput): """Takes the text input in the field""" @@ -835,14 +840,14 @@ class MyTextInput(TextInput): def on_text(self, instance, value): """Find all the occurrence of the word""" - self.parent.parent.parent.parent.ids.rv.data = [] + self.parent.parent.parent.parent.parent.ids.rv.data = [] matches = [self.word_list[i] for i in range( len(self.word_list)) if self.word_list[ i][:self.starting_no] == value[:self.starting_no]] display_data = [] for i in matches: display_data.append({'text': i}) - self.parent.parent.parent.parent.ids.rv.data = display_data + self.parent.parent.parent.parent.parent.ids.rv.data = display_data if len(matches) <= 10: self.parent.height = (250 + (len(matches) * 20)) else: @@ -874,6 +879,9 @@ class Payment(Screen): state.kivyapp.root.ids.sc18.ids.cred.text = '{0}'.format( state.availabe_credit) + def move_to_pay_option(self, amount): + state.kivyapp.set_toolbar_for_QrCode() + class Credits(Screen): """Credits Method""" @@ -1579,6 +1587,9 @@ class NavigateApp(MDApp): self.root.ids.scr_mngr.current = 'myaddress' elif self.root.ids.scr_mngr.current == "random": self.root.ids.scr_mngr.current = 'login' + elif self.root.ids.scr_mngr.current == 'pay-options': + self.set_common_header() + self.root.ids.scr_mngr.current = 'payment' else: if state.kivyapp.variable_1: self.root.ids.scr_mngr.current = 'inbox' @@ -1704,7 +1715,8 @@ class NavigateApp(MDApp): if state.in_composer else 'allmails'\ if state.is_allmail else state.detailPageType\ if state.detailPageType else 'myaddress'\ - if self.root.ids.scr_mngr.current == 'showqrcode' else 'inbox' + if self.root.ids.scr_mngr.current == 'showqrcode' else 'payment'\ + if self.root.ids.scr_mngr.current == 'pay-options' else 'inbox' self.root.ids.scr_mngr.transition.direction = 'right' self.root.ids.scr_mngr.transition.bind(on_complete=self.reset) if state.is_allmail or state.detailPageType == 'draft': @@ -1842,7 +1854,7 @@ class NavigateApp(MDApp): def set_identicon(self, text): """Show identicon in address spinner""" img = identiconGeneration.generate(text) - self.root.children[0].children[0].ids.btn.children[1].texture = (img.texture) + # self.root.children[0].children[0].ids.btn.children[1].texture = (img.texture) # below line is for displaing logo self.root.ids.content_drawer.ids.top_box.children[0].texture = (img.texture) @@ -1941,10 +1953,11 @@ class NavigateApp(MDApp): def load_selected_Image(self, curerentAddr): """This method load the selected image on screen""" top_box_obj = self.root.ids.content_drawer.ids.top_box.children[0] - spinner_img_obj = self.root.ids.content_drawer.ids.btn.children[1] - spinner_img_obj.source = top_box_obj.source ='./images/default_identicon/{0}.png'.format(curerentAddr) + # spinner_img_obj = self.root.ids.content_drawer.ids.btn.children[1] + # spinner_img_obj.source = top_box_obj.source ='./images/default_identicon/{0}.png'.format(curerentAddr) + top_box_obj.source ='./images/default_identicon/{0}.png'.format(curerentAddr) top_box_obj.reload() - spinner_img_obj.reload() + # spinner_img_obj.reload() def copy_composer_text(self, text): """Copy the data from mail detail page""" @@ -2096,6 +2109,12 @@ class ToggleBtn(IRightBodyTouch, MDSwitch): pass +class CheckboxLeftSampleWidget(ILeftBodyTouch, MDCheckbox): + """Left icon sample widget""" + + pass + + class MailDetail(Screen): """MailDetail Screen uses to show the detail of mails""" @@ -2945,5 +2964,12 @@ class ToAddrBoxlayout(BoxLayout): to_addr = StringProperty() def set_toAddress(self, to_addr): + """This method is use to set to address""" self.to_addr = to_addr + + +class PaymentMethods(Screen): + """PaymentMethods Screen show widgets of page""" + + def redirect_on_web(self, instance): pass diff --git a/src/images/paymode/111.webp b/src/images/paymode/111.webp new file mode 100644 index 0000000000000000000000000000000000000000..7b38349ef0960b155561a9ee39f72662d008ff24 GIT binary patch literal 11484 zcmV<2EF;rWNk&H0EC2vkMM6+kP&iD;EC2v6r@~kO7v(m#ZB@DQ-32l#paf``kW#Dy zGIxJ=u_7SXwwp-$lAD=f$++rdI=c?617OA(wMnof$u@2E@wKh@<=MUY+Pe0=3qAiS z%Ag=1Bmi|z1Hd72WXQN^v{%uO(C3K<`Alt#q@7T|6YYd@;weWjIZ{?wuXIq>DHDu~ z4gv|05J+^!8{?JrN;zS?&`ubqY%rn(5rjyToYH(LRCmFaH@2y%Lrg(Bz{YUGQId!q zvy()C$ss#5;04jAxdA@0m>_MsyyKGtCRRWI13&|UfCYsB0tgWS{s2S>AOR^bfIyDO z8pB3B*qM;fK4M}l(1-`}HLwl=>q41NJfwgwp|IIh)MB^Cg{IH}<%TeT7eW*X$sh}h zihCw-GbhQhLUJ9U6oowEQIF3Z*E>BkC;PDGO2QydCsH=q;3QMcPm*3itPp^1(;aUS zNIRLZ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_qN1eiyKJv z_VRvz=;w9l8zX-tVCqg)wXF*Mn*oS6ODn=ntpM;RLU*r3@b>~DPyj|`Q!W7W2fF%z zC}2oU&R+~shyd72@c)qqYBmKqe=iiFBPp8NYr`K_BlX3wRLKAMm&g9M$Nsm+{x<>0 CASsyu literal 0 HcmV?d00001 diff --git a/src/images/paymode/bitcoin-logo.jpg b/src/images/paymode/bitcoin-logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a5c5bdbb44d1a92e2ae294ff76a2ab37578ef704 GIT binary patch literal 8457 zcmeHLby!qiw?4zrpmc|n2}>^xp+Q^#CNe7!sHO7{mf#kbuA>AXG0vhc*xcd~NE#E-Y*eFeV5GwFuz;X>W!8 zOZNYT{~I#^zRhPT8`fOaY=a}M#=(%Hj+0c^dGh|+QPd`9ueaoH%p_th@db0y&_ioy z6AQgT7Bv~I-Dm+uI<0jm^hQG+&sRIDE>S(@EhQ(p#=EpbrDSsu^kCJ8jx*53e`njXSyPwJiW3ayVn&*TZ%xQTI z{wi*FaOyJ>imYPz&Rm|wf9YP4wEuLCz;vb{xPmjv#rpBK_;`WrB*u!6G0!$axT+h> zU$oWt0EuIHG{5+y(6jT1bD8g=r_~%J>~-A{9|^qOkCLZk?+ZtA+35#gnq2c^} z`|D6#FCNbuQ99kv(d}A4DOkZ?)Tv^~J5mraM{be%S^mrG?l|dP;J|0tR=d#?l+s_g z9qV0T0{0e9{bNhwaCrXwrw{eLg(r8t)MS8n4`#o{Of;b%2w{rs z?~nJeG%3&{Bo0)(n9)cGvYOc&JiWDp-x{`mjX@%aTzC@S=-=-5e3M~{R`$umeN0cz zmSO!3hDUweqAMZz7WU2)-DvDXjCM2Gn9OlO9W%rEa_wIgAJG=07YhIy$6%PGJrDQk zd;Zx%M!x+Mg$vov!{0wK530uV)(aZ3$Y6-4;BC|L8kTh0{my|&f`IV?nc1ACJ8~20 zt=C3ikR@q` z&atoVF}vsb>)scAehold=)?G9capIDQN=PBT|;ESn3dET_ZA8$iA>O0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!n?-z>>4StNj50JeRutHnf!k%P+IstJ z=h_|FCG#4mIU%BIZ&P>0S_*?xoE^DMqxzk=2ota!4U>2`f5`U#YuJAQ-4pT<$Yew& zRBsQd;^lS=CW3Qex2mSIi~<^L?*mu!^~LubBAd zlW!nB(xwr<37FO(6foV4PA~D2pwmm>>jW#--;66dy#!#A5R;M#>gqAG2r2lIGubNY z+a)DO{7Jxq(8;8$o>kM09|Giah}-hn=f6;ZZD~hT=l2u&NFgFKHvIh4U)4_!NHqrK z91Ju_jU&i7dB1sr8r ziqbSAVob7r`8MdWr94O)?D3f&RbDqVS<+$-0kL_RwKavPJ4(lJGr^hS86c%g?4OVC(k-bg%AH;W$eld65+4k=ff#l0{Rr7G)VZ5!?5!r#-AJ|#{E zdY@V8@2w|jo~dtr(LY)jLjlI&0rY+RrQw0@(<`^b7>F^t$s)32rF%rk6B8U=+b2u%?QWd^#!%f6QvQ+W`FBr)-9aQ zoD}GRw$1mADSf-wH`7JoC!_d+X>BLvo|xgtK}}V6S;4ki1s4R zUmsrQ2mumOOkzP@TQX(^J#r=%A^nJ?yvEM#FAw1}6`^g4?-_dp~I?iyIa`pHC{@oHurV$rKxDVzZT)L_zqT_bSKSNw@o% zJ~QlvjFsre7W6t)}eOWb0 zDaId+5}cU62G2?9-S0mo`q>ayb$i8HWB7>2o{n*b*6EAuX|?QBC?(E_Vep#ZhJ7ES zj`5UeX>-fMOMG?mBi_2OX+GAlWNQkl(4fJWKSco^(gPm5_^?19%_J389Nmwe3XR&P zoX=RK2P;m`3O#BxUaN?+U+k5B!8xi{5RdkFG9@3$C+1*G$vTv-2*m-1ye3IFMSsT4 r+Gmv<%D_2bogR;zjW#3n-D2>RGsHP+v28!FG(7!;0xVDfYT-WsU)BsZ literal 0 HcmV?d00001 diff --git a/src/images/paymode/download.png b/src/images/paymode/download.png new file mode 100644 index 0000000000000000000000000000000000000000..68c7f0876f3eb457dc10e0f432b8f60a0b1740ff GIT binary patch literal 5678 zcmV+}7SZX6P)h}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xc2AZGQYIWRcpT5XATY#ARVGM#-f+*~-{w`1WXi@da{1{rkJzHh}M zIUtr+z3cxVTqP`3l)ivxhS?FnR8cM)fUs0-Co!G6fMOG^X!7LF*Uv)0zqkSIOO_|=Ot z%!}Kk1)5X8wj{&sNU~`&a~{jYh5W`NH91TDl@&dfiIbP@7(AqWl}3gP8UDfef6a}~ Uz8pvD7XSbN07*qoM6N<$f=jCuaR2}S literal 0 HcmV?d00001 From c8a08919ee23c9be0e49d994bf9aeddac1482c9d Mon Sep 17 00:00:00 2001 From: navjot Date: Tue, 17 Mar 2020 17:12:16 +0530 Subject: [PATCH 2/8] implemented address disable feature or fixed issues --- python3_requirements.txt | 2 +- src/bitmessagekivy/kv/common_widgets.kv | 1 + src/bitmessagekivy/kv/composer.kv | 2 +- src/bitmessagekivy/kv/login.kv | 1 - src/bitmessagekivy/kv/settings.kv | 41 +++++++++------- src/bitmessagekivy/mpybit.py | 63 +++++++++++++++++-------- 6 files changed, 71 insertions(+), 39 deletions(-) diff --git a/python3_requirements.txt b/python3_requirements.txt index 1115fe09..c9957e22 100644 --- a/python3_requirements.txt +++ b/python3_requirements.txt @@ -6,7 +6,7 @@ idna==2.8 isort==4.3.21 Kivy==1.11.1 Kivy-Garden==0.1.4 -git+https://github.com/HeaTTheatR/KivyMD.git +git+https://github.com/surbhicis/KivyMD-1 lazy-object-proxy==1.4.3 mccabe==0.6.1 Pillow==6.1.0 diff --git a/src/bitmessagekivy/kv/common_widgets.kv b/src/bitmessagekivy/kv/common_widgets.kv index e3bd5242..3865f9c8 100644 --- a/src/bitmessagekivy/kv/common_widgets.kv +++ b/src/bitmessagekivy/kv/common_widgets.kv @@ -53,6 +53,7 @@ : canvas: Color: + id: set_clr # rgba: 0.5, 0.5, 0.5, 0.5 rgba: 0,0,0,0 Rectangle: #woohoo!!! diff --git a/src/bitmessagekivy/kv/composer.kv b/src/bitmessagekivy/kv/composer.kv index e108cb1d..b68e281d 100644 --- a/src/bitmessagekivy/kv/composer.kv +++ b/src/bitmessagekivy/kv/composer.kv @@ -47,7 +47,7 @@ size_hint_y: None font_size: '15sp' height: self.parent.height/2 - # hint_text: 'type, select or scan QR code for recipients address' + hint_text: 'type, select or scan QR code for recipients address' RV: id: rv MDIconButton: diff --git a/src/bitmessagekivy/kv/login.kv b/src/bitmessagekivy/kv/login.kv index fc2873bd..c6c90330 100644 --- a/src/bitmessagekivy/kv/login.kv +++ b/src/bitmessagekivy/kv/login.kv @@ -87,7 +87,6 @@ text: "Here you may generate as many addresses as you like, Indeed creating and abandoning addresses is encouraged" halign: 'center' color:app.theme_cls.primary_dark - MDTextField: id: label multiline: False diff --git a/src/bitmessagekivy/kv/settings.kv b/src/bitmessagekivy/kv/settings.kv index 8e947c2b..0ca5c4ab 100644 --- a/src/bitmessagekivy/kv/settings.kv +++ b/src/bitmessagekivy/kv/settings.kv @@ -43,6 +43,7 @@ id: dropdown_item text: 'italiano' dropdown_max_height: 150 + dropdown_bg: [1, 1, 1, 1] pos_hint: {'center_x': 0.8, 'center_y': 0} items: [f"{i}" for i in ['System Setting','U.S. English','italiano','Esperanto','dansk','Deutsch','Pirate English','francais','Nederlands','norsk bokmal','polski','portugues europeu']] BoxLayout: @@ -284,26 +285,25 @@ halign: 'left' bold: True - BoxLayout: - orientation: 'horizontal' + GridLayout: + cols: 2 padding: [10, 0, 0, 0] - BoxLayout: - orientation: 'horizontal' - MDLabel: - font_style: 'Body1' - theme_text_color: 'Primary' - text: "Type:" - halign: 'left' - BoxLayout: - orientation: 'horizontal' - MDDropDownItem: - id: dropdown_item - dropdown_bg: [1, 1, 1, 1] - text: 'none' - items: [f"{i}" for i in ['System Setting','U.S. English']] + MDLabel: + size_hint_x: None + font_style: 'Body1' + theme_text_color: 'Primary' + text: "Type:" + halign: 'left' + MDDropDownItem: + id: dropdown_item + dropdown_bg: [1, 1, 1, 1] + text: 'none' + pos_hint: {'x': 0.9, 'y': 0} + items: [f"{i}" for i in ['System Setting','U.S. English']] BoxLayout: orientation: 'horizontal' padding: [30, 0, 0, 0] + spacing: 10 BoxLayout: orientation: 'horizontal' MDLabel: @@ -323,6 +323,14 @@ theme_text_color: 'Primary' text: "Port:" halign: 'left' + # TextInput: + # size_hint: None, None + # hint_text: '9050' + # size: dp(app.window_size[0]/4), dp(30) + # input_filter: "int" + # readonly: False + # multiline: False + # font_size: '15sp' MDTextFieldRect: size_hint: None, None size: dp(app.window_size[0]/4), dp(30) @@ -332,6 +340,7 @@ BoxLayout: orientation: 'horizontal' padding: [30, 0, 0, 0] + spacing: 10 BoxLayout: orientation: 'horizontal' MDLabel: diff --git a/src/bitmessagekivy/mpybit.py b/src/bitmessagekivy/mpybit.py index 97a7fa89..270216b0 100644 --- a/src/bitmessagekivy/mpybit.py +++ b/src/bitmessagekivy/mpybit.py @@ -396,7 +396,10 @@ class MyAddress(Screen): theme_text_color='Custom' if is_enable == 'true' else 'Primary', text_color=NavigateApp().theme_cls.primary_color, ) - meny.canvas.children[6].rgba = [0, 0, 0, 0] if is_enable == 'true' else [0.5, 0.5, 0.5, 0.5] + try: + meny.canvas.children[6].rgba = [0, 0, 0, 0] if is_enable == 'true' else [0.5, 0.5, 0.5, 0.5] + except Exception as e: + meny.canvas.children[9].rgba = [0, 0, 0, 0] if is_enable == 'true' else [0.5, 0.5, 0.5, 0.5] meny.add_widget(AvatarSampleWidget( source='./images/text_images/{}.png'.format( avatarImageFirstLetter(item['text'].strip())))) @@ -498,7 +501,10 @@ class MyAddress(Screen): BMConfigParser().set(str(address), 'enabled', 'false') BMConfigParser().save() instance.parent.parent.theme_text_color = 'Primary' - instance.parent.parent.canvas.children[6].rgba = [0.5, 0.5, 0.5, 0.5] + try: + instance.parent.parent.canvas.children[6].rgba = [0.5, 0.5, 0.5, 0.5] + except Exception as e: + instance.parent.parent.canvas.children[9].rgba = [0.5, 0.5, 0.5, 0.5] toast('Address disabled') Clock.schedule_once(self.address_permision_callback, 0) @@ -507,7 +513,10 @@ class MyAddress(Screen): BMConfigParser().set(address, 'enabled', 'true') BMConfigParser().save() instance.parent.parent.theme_text_color = 'Custom' - instance.parent.parent.canvas.children[6].rgba = [0, 0, 0, 0] + try: + instance.parent.parent.canvas.children[6].rgba = [0, 0, 0, 0] + except Exception as e: + instance.parent.parent.canvas.children[9].rgba = [0, 0, 0, 0] toast('Address Enabled') Clock.schedule_once(self.address_permision_callback, 0) @@ -905,6 +914,7 @@ class Login(Screen): ' choose a weak passphrase and someone on the Internet can brute-force it,' ' they can read your messages and send messages as you') + class NetworkStat(Screen): """Method used to show network stat""" @@ -1118,15 +1128,21 @@ class Sent(Screen): if len(self.ids.ml.children) < 3: self.ids.ml.clear_widgets() self.loadSent() - total_sent = int(state.sent_count) + 1 - state.sent_count = str(int(state.sent_count) +1) - self.set_sentCount(total_sent) + if state.association == state.check_sent_acc: + total_sent = int(state.sent_count) + 1 + state.sent_count = str(int(state.sent_count) +1) + self.set_sentCount(total_sent) + else: + total_sent = int(state.sent_count) else: data = [] self.sentDataQuery('fromaddress', '', '', 0, 1) - total_sent = int(state.sent_count) + 1 - state.sent_count = str(int(state.sent_count) +1) - self.set_sentCount(total_sent) + if state.association == state.check_sent_acc: + total_sent = int(state.sent_count) + 1 + state.sent_count = str(int(state.sent_count) +1) + self.set_sentCount(total_sent) + else: + total_sent = int(state.sent_count) for mail in self.queryreturn: data.append({ 'text': mail[1].strip(), @@ -1740,12 +1756,13 @@ class NavigateApp(MDApp): def set_message_count(self): """Setting message count""" - try: - msg_counter_objs = ( - self.root_window.children[0].children[2].children[0].ids) - except Exception: - msg_counter_objs = ( - self.root_window.children[2].children[2].children[0].ids) + msg_counter_objs = state.kivyapp.root.children[0].children[0].ids + # try: + # msg_counter_objs = ( + # self.root_window.children[0].children[2].children[0].ids) + # except Exception: + # msg_counter_objs = ( + # self.root_window.children[2].children[2].children[0].ids) self.get_inbox_count() self.get_sent_count() state.trash_count = str(sqlQuery( @@ -2230,14 +2247,20 @@ class MailDetail(Screen): def inbox_reply(self): """Reply inbox messages""" data = sqlQuery( - "select toaddress, fromaddress, subject, message from inbox where" + "select toaddress, fromaddress, subject, message, received from inbox where" " msgid = ?;", state.mail_id) composer_obj = self.parent.screens[2].children[1].ids composer_obj.ti.text = data[0][0] composer_obj.btn.text = data[0][0] composer_obj.txt_input.text = data[0][1] - composer_obj.subject.text = data[0][2] - composer_obj.body.text = '' + split_subject = data[0][2].split('Re:', 1) + composer_obj.subject.text = 'Re: ' +(split_subject[1] if len(split_subject)>1 else split_subject[0]) + time_obj = datetime.fromtimestamp(int(data[0][4])) + time_tag = time_obj.strftime("%d %b %Y, %I:%M %p") + sender_name = BMConfigParser().get(data[0][1], 'label') + composer_obj.body.text = '\n\n ------------------------On '+time_tag+', '+sender_name+' wrote:-----------------------\n' + data[0][3] + composer_obj.body.focus = True + composer_obj.body.cursor = (0, 0) state.kivyapp.root.ids.sc3.children[1].ids.rv.data = '' self.parent.current = 'create' state.kivyapp.set_navbar_for_composer() @@ -2334,8 +2357,8 @@ class AddbookDetailPopup(Popup): "UPDATE addressbook SET label = '{}' WHERE" " address = '{}';".format( str(self.ids.add_label.text), address)) - self.parent.children[1].ids.sc11.ids.ml.clear_widgets() - self.parent.children[1].ids.sc11.loadAddresslist(None, 'All', '') + state.kivyapp.root.ids.sc11.ids.ml.clear_widgets() + state.kivyapp.root.ids.sc11.loadAddresslist(None, 'All', '') self.dismiss() toast('Saved') From 17a79949181863c0a1b82c7afa6d3c28a6c3edcc Mon Sep 17 00:00:00 2001 From: navjot Date: Tue, 17 Mar 2020 21:32:52 +0530 Subject: [PATCH 3/8] worked on fixing network UI or changed requirement.txt file --- python3_requirements.txt | 3 +- src/bitmessagekivy/kv/network.kv | 100 +++++++++++++++---------------- 2 files changed, 51 insertions(+), 52 deletions(-) diff --git a/python3_requirements.txt b/python3_requirements.txt index c9957e22..bf9f860c 100644 --- a/python3_requirements.txt +++ b/python3_requirements.txt @@ -6,11 +6,10 @@ idna==2.8 isort==4.3.21 Kivy==1.11.1 Kivy-Garden==0.1.4 -git+https://github.com/surbhicis/KivyMD-1 +-e git+https://github.com/surbhicis/KivyMD-1#egg=kivymd lazy-object-proxy==1.4.3 mccabe==0.6.1 Pillow==6.1.0 -pkg-resources==0.0.0 pydenticon==0.3.1 Pygments==2.4.2 pylint==2.4.4 diff --git a/src/bitmessagekivy/kv/network.kv b/src/bitmessagekivy/kv/network.kv index 80d1bba1..25f2bacc 100644 --- a/src/bitmessagekivy/kv/network.kv +++ b/src/bitmessagekivy/kv/network.kv @@ -15,16 +15,16 @@ OneLineListItem: text: "Total Connections" BoxLayout: - AnchorLayout: - MDRaisedButton: - size_hint: .6, .3 - height: dp(40) - MDLabel: - font_style: 'H6' - text: root.text_variable_1 - font_size: '13sp' - color: (1,1,1,1) - halign: 'center' + orientation: 'vertical' + size_hint_y: None + height: dp(58) + MDRaisedButton: + size_hint: .5, 0 + height: dp(40) + text: root.text_variable_1 + elevation_normal: 2 + opposite_colors: True + pos_hint: {'center_x': .5} Tab: text: 'Processes' ScrollView: @@ -36,52 +36,52 @@ OneLineListItem: text: "person-to-person" BoxLayout: - AnchorLayout: - MDRaisedButton: - size_hint: .7, .55 - height: dp(40) - MDLabel: - font_style: 'H6' - text: root.text_variable_2 - font_size: '13sp' - color: (1,1,1,1) - halign: 'center' + orientation: 'vertical' + size_hint_y: None + height: dp(58) + MDRaisedButton: + size_hint: .5, 0 + height: dp(40) + text: root.text_variable_2 + elevation_normal: 2 + opposite_colors: True + pos_hint: {'center_x': .5} OneLineListItem: text: "Brodcast" BoxLayout: - AnchorLayout: - MDRaisedButton: - size_hint: .7, .55 - height: dp(40) - MDLabel: - font_style: 'H6' - text: root.text_variable_3 - font_size: '13sp' - color: (1,1,1,1) - halign: 'center' + orientation: 'vertical' + size_hint_y: None + height: dp(58) + MDRaisedButton: + size_hint: .5, 0 + height: dp(40) + text: root.text_variable_3 + elevation_normal: 2 + opposite_colors: True + pos_hint: {'center_x': .5} OneLineListItem: text: "publickeys" BoxLayout: - AnchorLayout: - MDRaisedButton: - size_hint: .7, .55 - height: dp(40) - MDLabel: - font_style: 'H6' - text: root.text_variable_4 - font_size: '13sp' - color: (1,1,1,1) - halign: 'center' + orientation: 'vertical' + size_hint_y: None + height: dp(58) + MDRaisedButton: + size_hint: .5, 0 + height: dp(40) + text: root.text_variable_4 + elevation_normal: 2 + opposite_colors: True + pos_hint: {'center_x': .5} OneLineListItem: text: "objects" BoxLayout: - AnchorLayout: - MDRaisedButton: - size_hint: .7, .55 - height: dp(40) - MDLabel: - font_style: 'H6' - text: root.text_variable_5 - font_size: '13sp' - color: (1,1,1,1) - halign: 'center' \ No newline at end of file + orientation: 'vertical' + size_hint_y: None + height: dp(58) + MDRaisedButton: + size_hint: .5, 0 + height: dp(40) + text: root.text_variable_5 + elevation_normal: 2 + opposite_colors: True + pos_hint: {'center_x': .5} From be178f23ae91eae5dba72836de8db8bab3ca9373 Mon Sep 17 00:00:00 2001 From: "jai.s" Date: Wed, 18 Mar 2020 15:26:02 +0530 Subject: [PATCH 4/8] Solved inventory issue --- src/class_singleWorker.py | 7 +++---- src/inventory.py | 15 ++++++++++++--- src/network/bmobject.py | 2 +- src/network/bmproto.py | 7 +++---- src/network/downloadthread.py | 2 +- src/network/tcp.py | 2 +- 6 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/class_singleWorker.py b/src/class_singleWorker.py index d9f5ba31..26c16809 100644 --- a/src/class_singleWorker.py +++ b/src/class_singleWorker.py @@ -455,7 +455,7 @@ class singleWorker(StoppableThread): inventoryHash = calculateInventoryHash(payload) objectType = 1 - Inventory()._realInventory[inventoryHash] = ( + Inventory()[inventoryHash] = ( objectType, streamNumber, payload, embeddedTime, doubleHashOfAddressData[32:] ) @@ -1239,7 +1239,7 @@ class singleWorker(StoppableThread): objectType = 2 inventoryHashlist = ( objectType, toStreamNumber,encryptedPayload, embeddedTime, '') - Inventory()._realInventory[inventoryHash] = ( + Inventory()[inventoryHash] = ( objectType, toStreamNumber, encryptedPayload, embeddedTime, '') if BMConfigParser().has_section(toaddress) or \ not protocol.checkBitfield(behaviorBitfield, protocol.BITFIELD_DOESACK): @@ -1393,9 +1393,8 @@ class singleWorker(StoppableThread): payload = self._doPOWDefaults(payload, TTL) inventoryHash = calculateInventoryHash(payload) objectType = 1 - Inventory()._realInventory[inventoryHash] = ( + Inventory()[inventoryHash] = ( objectType, streamNumber, payload, embeddedTime, '') - # Inventory()._realInventory[inventoryHashlist] self.logger.info('sending inv (for the getpubkey message)') queues.invQueue.put((streamNumber, inventoryHash)) # wait 10% past expiration diff --git a/src/inventory.py b/src/inventory.py index fc06e455..d0c0a829 100644 --- a/src/inventory.py +++ b/src/inventory.py @@ -24,8 +24,8 @@ class Inventory(): # cheap inheritance copied from asyncore def __getattr__(self, attr): - if attr == "__contains__": - self.numberOfInventoryLookupsPerformed += 1 + # if attr == "__contains__": + # self.numberOfInventoryLookupsPerformed += 1 try: realRet = getattr(self._realInventory, attr) except AttributeError: @@ -36,6 +36,15 @@ class Inventory(): else: return realRet + # on python3 we have separately added __contains__ method + def __contains__(self, attr): + self.numberOfInventoryLookupsPerformed += 1 + return getattr(self._realInventory, '__contains__')(attr) + + # on python3 we have separately added __setitem__ method + def __setitem__(self, hash_, value): + return getattr(self._realInventory,'__setitem__')(hash_,value) + # hint for pylint: this is dictionary like object def __getitem__(self, key): - return self._realInventory[key] + return self._realInventory[key] \ No newline at end of file diff --git a/src/network/bmobject.py b/src/network/bmobject.py index ee3bd388..12b997d7 100644 --- a/src/network/bmobject.py +++ b/src/network/bmobject.py @@ -116,7 +116,7 @@ class BMObject(object): # pylint: disable=too-many-instance-attributes # if it's a stem duplicate, pretend we don't have it if Dandelion().hasHash(self.inventoryHash): return - if self.inventoryHash in Inventory()._realInventory: + if self.inventoryHash in Inventory(): raise BMObjectAlreadyHaveError() def checkObjectByType(self): diff --git a/src/network/bmproto.py b/src/network/bmproto.py index e98bdf93..e4f09caf 100644 --- a/src/network/bmproto.py +++ b/src/network/bmproto.py @@ -357,7 +357,7 @@ class BMProto(AdvancedDispatcher, ObjectTracker): if dandelion and not state.dandelion: return True for i in map(bytes, items): - if i in Inventory()._realInventory and not Dandelion().hasHash(i): + if i in Inventory() and not Dandelion().hasHash(i): continue if dandelion and not Dandelion().hasHash(i): Dandelion().addHash(i, self) @@ -417,10 +417,9 @@ class BMProto(AdvancedDispatcher, ObjectTracker): del missingObjects[self.object.inventoryHash] except KeyError: pass - - if self.object.inventoryHash in Inventory()._realInventory and Dandelion().hasHash(self.object.inventoryHash): + if self.object.inventoryHash in Inventory() and Dandelion().hasHash(self.object.inventoryHash): Dandelion().removeHash(self.object.inventoryHash, "cycle detection") - Inventory()._realInventory[self.object.inventoryHash] = ( + Inventory()[self.object.inventoryHash] = ( self.object.objectType, self.object.streamNumber, memoryview(self.payload[objectOffset:]), self.object.expiresTime, memoryview(self.object.tag) diff --git a/src/network/downloadthread.py b/src/network/downloadthread.py index bf0344b3..323819ca 100644 --- a/src/network/downloadthread.py +++ b/src/network/downloadthread.py @@ -61,7 +61,7 @@ class DownloadThread(StoppableThread): payload = bytearray() chunkCount = 0 for chunk in request: - if chunk in Inventory()._realInventory and not Dandelion().hasHash(chunk): + if chunk in Inventory() and not Dandelion().hasHash(chunk): try: del i.objectsNewToMe[chunk] except KeyError: diff --git a/src/network/tcp.py b/src/network/tcp.py index 72a66772..1d3696ed 100644 --- a/src/network/tcp.py +++ b/src/network/tcp.py @@ -211,7 +211,7 @@ class TCPConnection(BMProto, TLSDispatcher): # may lock for a long time, but I think it's better than # thousands of small locks with self.objectsNewToThemLock: - for objHash in Inventory()._realInventory.unexpired_hashes_by_stream(stream): + for objHash in Inventory().unexpired_hashes_by_stream(stream): # don't advertise stem objects on bigInv if Dandelion().hasHash(objHash): continue From 6650876b5724617aaffe3a3515a32a8a7b53450c Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Wed, 18 Mar 2020 16:07:02 +0530 Subject: [PATCH 5/8] quality fixes after pull --- src/api.py | 35 -------- src/bitmessagekivy/mpybit.py | 146 ++++++++++++++++++---------------- src/bmconfigparser.py | 1 - src/class_objectProcessor.py | 4 +- src/class_singleWorker.py | 28 +++---- src/helper_msgcoding.py | 1 - src/inventory.py | 2 +- src/messagetypes/message.py | 2 +- src/network/bmobject.py | 1 + src/network/bmproto.py | 10 +-- src/network/downloadthread.py | 2 +- src/network/invthread.py | 4 +- src/network/tcp.py | 4 +- src/proofofwork.py | 1 - src/protocol.py | 2 +- src/shared.py | 1 - src/storage/sqlite.py | 8 +- 17 files changed, 111 insertions(+), 141 deletions(-) diff --git a/src/api.py b/src/api.py index e6771f4b..6b1192c4 100644 --- a/src/api.py +++ b/src/api.py @@ -3,16 +3,9 @@ This is not what you run to run the Bitmessage API. Instead, enable the API ( https://bitmessage.org/wiki/API ) and optionally enable daemon mode ( https://bitmessage.org/wiki/Daemon ) then run bitmessagemain.py. """ -<<<<<<< HEAD # Copyright (c) 2012-2016 Jonathan Warren # Copyright (c) 2012-2020 The Bitmessage developers # pylint: disable=too-many-lines,no-self-use,unused-variable,unused-argument -======= -# pylint: disable=too-many-locals,too-many-lines,no-self-use,unused-argument -# pylint: disable=too-many-statements,too-many-public-methods,too-many-branches -# Copyright (c) 2012-2016 Jonathan Warren -# Copyright (c) 2012-2019 The Bitmessage developers ->>>>>>> 86df28c260eb1dd4acae506c1366f3cf136c5840 import base64 import errno import hashlib @@ -34,7 +27,6 @@ import queues import shared import shutdown import state -<<<<<<< HEAD from addresses import ( addBMIfNotPresent, calculateInventoryHash, @@ -42,21 +34,13 @@ from addresses import ( decodeVarint, varintDecodeError ) -======= - -from addresses import addBMIfNotPresent, calculateInventoryHash, decodeAddress, decodeVarint, varintDecodeError ->>>>>>> 86df28c260eb1dd4acae506c1366f3cf136c5840 from bmconfigparser import BMConfigParser from debug import logger from helper_ackPayload import genAckPayload from helper_sql import SqlBulkExecute, sqlExecute, sqlQuery, sqlStoredProcedure from inventory import Inventory from network.threads import StoppableThread -<<<<<<< HEAD from version import softwareVersion -======= -# pylint: disable=unused-variable ->>>>>>> 86df28c260eb1dd4acae506c1366f3cf136c5840 str_chan = '[chan]' @@ -275,13 +259,9 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): raise APIError(9, 'Invalid characters in address: ' + address) if status == 'versiontoohigh': raise APIError( -<<<<<<< HEAD 10, 'Address version number too high (or zero) in address: ' + address) -======= - 10, 'Address version number too high (or zero) in address: ' + address) ->>>>>>> 86df28c260eb1dd4acae506c1366f3cf136c5840 if status == 'varintmalformed': raise APIError(26, 'Malformed varint in address: ' + address) raise APIError( @@ -645,13 +625,8 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): label = str_chan + ' ' + passphrase except BaseException: label = str_chan + ' ' + repr(passphrase) -<<<<<<< HEAD status, addressVersionNumber, streamNumber, toRipe = ( self._verifyAddress(suppliedAddress)) -======= - status, addressVersionNumber, streamNumber, toRipe = self._verifyAddress( - suppliedAddress) ->>>>>>> 86df28c260eb1dd4acae506c1366f3cf136c5840 suppliedAddress = addBMIfNotPresent(suppliedAddress) queues.apiAddressGeneratorReturnQueue.queue.clear() queues.addressGeneratorQueue.put(( @@ -674,13 +649,8 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): raise APIError(0, 'I need parameters.') elif len(params) == 1: address, = params -<<<<<<< HEAD status, addressVersionNumber, streamNumber, toRipe = ( self._verifyAddress(address)) -======= - status, addressVersionNumber, streamNumber, toRipe = \ - self._verifyAddress(address) ->>>>>>> 86df28c260eb1dd4acae506c1366f3cf136c5840 address = addBMIfNotPresent(address) if not BMConfigParser().has_section(address): raise APIError( @@ -701,13 +671,8 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): raise APIError(0, 'I need parameters.') elif len(params) == 1: address, = params -<<<<<<< HEAD status, addressVersionNumber, streamNumber, toRipe = ( self._verifyAddress(address)) -======= - status, addressVersionNumber, streamNumber, toRipe = \ - self._verifyAddress(address) ->>>>>>> 86df28c260eb1dd4acae506c1366f3cf136c5840 address = addBMIfNotPresent(address) if not BMConfigParser().has_section(address): raise APIError( diff --git a/src/bitmessagekivy/mpybit.py b/src/bitmessagekivy/mpybit.py index 270216b0..eb790b08 100644 --- a/src/bitmessagekivy/mpybit.py +++ b/src/bitmessagekivy/mpybit.py @@ -96,33 +96,35 @@ def ShowTimeHistoy(act_time): action_time = datetime.fromtimestamp(int(act_time)) crnt_date = datetime.now() duration = crnt_date - action_time - display_data = (action_time.strftime('%d/%m/%Y') + display_data = ( + action_time.strftime('%d/%m/%Y') if duration.days >= 365 else action_time.strftime('%I:%M %p').lstrip('0') if duration.days == 0 and crnt_date.strftime('%d/%m/%Y') == action_time.strftime('%d/%m/%Y') - else action_time.strftime("%d %b")) + else action_time.strftime("%d %b") + ) return display_data -def AddTimeWidget(time): +def AddTimeWidget(time): # pylint: disable=redefined-outer-name """This method is used to create TimeWidget""" action_time = BadgeText( - size_hint= (None, None), - text= f"{ShowTimeHistoy(time)}", + size_hint=(None, None), + text=str(ShowTimeHistoy(time)), halign='right', font_style='Caption', - size= [65,70]) + size=[65, 70]) return action_time def chipTag(text): """This method is used for showing chip tag""" obj = MDChip() - obj.size_hint= (None, None) - obj.label= text - obj.icon= '' - obj.pos_hint= {'center_x': .96, 'center_y': .2} - obj.height= dp(18) - obj.radius= 8 + obj.size_hint = (None, None) + obj.label = text + obj.icon = '' + obj.pos_hint = {'center_x': .96, 'center_y': .2} + obj.height = dp(18) + obj.radius = 8 return obj @@ -168,12 +170,13 @@ class Inbox(Screen): self.set_inboxCount(state.inbox_count) for mail in self.queryreturn: # third_text = mail[3].replace('\n', ' ') - body = mail[3].decode() if isinstance(mail[3],bytes) else mail[3] - subject = mail[5].decode() if isinstance(mail[5],bytes) else mail[5] + body = mail[3].decode() if isinstance(mail[3], bytes) else mail[3] + subject = mail[5].decode() if isinstance(mail[5], bytes) else mail[5] data.append({ 'text': mail[4].strip(), 'secondary_text': (subject[:50] + '........' if len( - subject) >= 50 else (subject + ',' + body)[0:50] + '........').replace('\t', '').replace(' ', ''), + subject) >= 50 else (subject + ',' + body)[0:50] + '........').replace( + '\t', '').replace(' ', ''), 'msgid': mail[1], 'received': mail[6]}) self.has_refreshed = True @@ -256,12 +259,12 @@ class Inbox(Screen): self.inboxDataQuery('toaddress', where, what, total_message, 5) for mail in self.queryreturn: # third_text = mail[3].replace('\n', ' ') - subject = mail[3].decode() if isinstance(mail[3],bytes) else mail[3] - body = mail[5].decode() if isinstance(mail[5],bytes) else mail[5] + subject = mail[3].decode() if isinstance(mail[3], bytes) else mail[3] + body = mail[5].decode() if isinstance(mail[5], bytes) else mail[5] data.append({ 'text': mail[4].strip(), 'secondary_text': body[:50] + '........' if len( - body) >= 50 else (body + ',' +subject.replace( + body) >= 50 else (body + ',' + subject.replace( '\n', ''))[0:50] + '........', 'msgid': mail[1]}) self.set_mdList(data) @@ -332,6 +335,7 @@ class Inbox(Screen): class CustomTwoLineAvatarIconListItem(TwoLineAvatarIconListItem): + """Custom Two Line Avatar Icon List""" pass @@ -406,13 +410,15 @@ class MyAddress(Screen): meny.bind(on_press=partial( self.myadd_detail, item['secondary_text'], item['text'])) if state.association == item['secondary_text']: - meny.add_widget(BadgeText(size_hint= (None, None), - text='Active', halign='right', - font_style='Body1', size= [50,60], - theme_text_color='Custom', - text_color=NavigateApp().theme_cls.primary_color)) + meny.add_widget( + BadgeText( + size_hint=(None, None), + text='Active', halign='right', + font_style='Body1', size=[50, 60], + theme_text_color='Custom', + text_color=NavigateApp().theme_cls.primary_color)) else: - meny.add_widget(ToggleBtn(active = True if is_enable == 'true' else False)) + meny.add_widget(ToggleBtn(active=True if is_enable == 'true' else False)) # carousel = Carousel(direction='right') # carousel.height = meny.height # carousel.size_hint_y = None @@ -495,7 +501,6 @@ class MyAddress(Screen): return True return False - def disableAddress(self, address, instance): """This method is use for disabling address""" BMConfigParser().set(str(address), 'enabled', 'false') @@ -845,7 +850,7 @@ class MyTextInput(TextInput): def __init__(self, **kwargs): """Getting Text Input.""" super(MyTextInput, self).__init__(**kwargs) - self.__lineBreak__=0 + self.__lineBreak__ = 0 def on_text(self, instance, value): """Find all the occurrence of the word""" @@ -888,24 +893,25 @@ class Payment(Screen): state.kivyapp.root.ids.sc18.ids.cred.text = '{0}'.format( state.availabe_credit) - def move_to_pay_option(self, amount): + def move_to_pay_option(self, amount): # pylint: disable=no-self-use + """Option move to pay""" state.kivyapp.set_toolbar_for_QrCode() class Credits(Screen): """Credits Method""" - available_credits = StringProperty( - '{0}'.format('€ 0')) + available_credits = StringProperty('{0}'.format('€ 0')) class Login(Screen): """Login Screeen""" - log_text1 = ('You may generate addresses by using either random numbers' - ' or by using a passphrase If you use a passphrase, the address' - ' is called a deterministic; address The Random Number option is' - ' selected by default but deterministic addresses have several pros' - ' and cons:') + log_text1 = ( + 'You may generate addresses by using either random numbers' + ' or by using a passphrase If you use a passphrase, the address' + ' is called a deterministic; address The Random Number option is' + ' selected by default but deterministic addresses have several pros' + ' and cons:') log_text2 = ('If talk about pros You can recreate your addresses on any computer' ' from memory, You need-not worry about backing up your keys.dat file' ' as long as you can remember your passphrase and aside talk about cons' @@ -1058,7 +1064,8 @@ class Sent(Screen): data.append({ 'text': mail[1].strip(), 'secondary_text': (mail[2][:50] + '........' if len( - mail[2]) >= 50 else (mail[2] + ',' + mail[3])[0:50] + '........').replace('\t', '').replace(' ', ''), + mail[2]) >= 50 else (mail[2] + ',' + mail[3])[0:50] + '........').replace( + '\t', '').replace(' ', ''), 'ackdata': mail[5], 'senttime': mail[6]},) self.set_mdlist(data, 0) self.has_refreshed = True @@ -1094,8 +1101,7 @@ class Sent(Screen): meny = TwoLineAvatarIconListItem( text=item['text'], secondary_text=item['secondary_text'], theme_text_color='Custom', - text_color=NavigateApp().theme_cls.primary_color - ) + text_color=NavigateApp().theme_cls.primary_color) meny.add_widget(AvatarSampleWidget( source='./images/text_images/{}.png'.format( avatarImageFirstLetter(item['secondary_text'].strip())))) @@ -1147,7 +1153,8 @@ class Sent(Screen): data.append({ 'text': mail[1].strip(), 'secondary_text': (mail[2][:50] + '........' if len( - mail[2]) >= 50 else (mail[2] + ',' + mail[3])[0:50] + '........').replace('\t', '').replace(' ', ''), + mail[2]) >= 50 else (mail[2] + ',' + mail[3])[0:50] + '........').replace( + '\t', '').replace(' ', ''), 'ackdata': mail[5], 'senttime': mail[6]}) self.set_mdlist(data, total_sent - 1) if state.msg_counter_objs and state.association == ( @@ -1305,8 +1312,8 @@ class Trash(Screen): """This method is used to create the mdlist""" total_trash_msg = len(self.ids.ml.children) for item in self.trash_messages: - subject = item[2].decode() if isinstance(item[2],bytes) else item[2] - body = item[3].decode() if isinstance(item[3],bytes) else item[3] + subject = item[2].decode() if isinstance(item[2], bytes) else item[2] + body = item[3].decode() if isinstance(item[3], bytes) else item[3] meny = TwoLineAvatarIconListItem( text=item[1], secondary_text=(item[2][:50] + '........' if len( @@ -1424,8 +1431,9 @@ class Setting(Screen): """Setting the Screen components""" exp_text = "By default, if you send a message to someone and he is offline for more than two days, Bitmessage will\ send the message again after an additional two days. This will be continued with exponential backoff\ - forever; messages will be resent after 5, 10, 20 days ect. until the receiver acknowledges them. Here you\ - may change that behavior by having Bitmessage give up after a certain number of days or months." + forever; messages will be resent after 5, 10, 20 days ect. until the receiver acknowledges them.\ + Here you may change that behavior by having Bitmessage give up after a certain number of days \ + or months." class NavigateApp(MDApp): @@ -1490,7 +1498,7 @@ class NavigateApp(MDApp): LoadingPopup().open() self.set_message_count() for nav_obj in self.root.ids.content_drawer.children[ - 0].children[0].children[0].children: + 0].children[0].children[0].children: nav_obj.active = True if nav_obj.text == 'Inbox' else False Clock.schedule_once(self.setCurrentAccountData, 0.5) @@ -1544,7 +1552,7 @@ class NavigateApp(MDApp): BMConfigParser().addresses()[0], android_path)) else: if not os.path.exists('./images/default_identicon/{}.png'.format( - BMConfigParser().addresses()[0])): + BMConfigParser().addresses()[0])): img.texture.save('./images/default_identicon/{}.png'.format( BMConfigParser().addresses()[0])) return BMConfigParser().addresses()[0] @@ -1583,7 +1591,7 @@ class NavigateApp(MDApp): return False def on_key(self, window, key, *args): - # pylint: disable=inconsistent-return-statements + # pylint: disable=inconsistent-return-statements, too-many-branches """Method is used for going on previous screen""" if key == 27: if state.in_search_mode and self.root.ids.scr_mngr.current != ( @@ -1687,7 +1695,6 @@ class NavigateApp(MDApp): state.in_composer = True state.in_sent_method = False - def set_navbar_for_composer(self): """Clearing toolbar data when composer open""" self.root.ids.toolbar.left_action_items = [ @@ -1936,7 +1943,6 @@ class NavigateApp(MDApp): def file_manager_open(self): """This method open the file manager of local system""" from kivymd.uix.filemanager import MDFileManager - from kivymd.uix.dialog import MDDialog self.manager = ModalView(size_hint=(1, 1), auto_dismiss=False) self.file_manager = MDFileManager( @@ -1955,7 +1961,7 @@ class NavigateApp(MDApp): from PIL import Image as PilImage if not os.path.exists('./images/default_identicon/'): os.makedirs('./images/default_identicon/') - newImg = PilImage.open(path).resize((300,300)) + newImg = PilImage.open(path).resize((300, 300)) newImg.save('./images/default_identicon/{0}.png'.format(state.association)) self.load_selected_Image(state.association) self.exit_manager() @@ -1972,11 +1978,11 @@ class NavigateApp(MDApp): top_box_obj = self.root.ids.content_drawer.ids.top_box.children[0] # spinner_img_obj = self.root.ids.content_drawer.ids.btn.children[1] # spinner_img_obj.source = top_box_obj.source ='./images/default_identicon/{0}.png'.format(curerentAddr) - top_box_obj.source ='./images/default_identicon/{0}.png'.format(curerentAddr) + top_box_obj.source = './images/default_identicon/{0}.png'.format(curerentAddr) top_box_obj.reload() # spinner_img_obj.reload() - def copy_composer_text(self, text): + def copy_composer_text(self, text): # pylint: disable=no-self-use """Copy the data from mail detail page""" Clipboard.copy(text) toast('Copied') @@ -2115,12 +2121,6 @@ class IconRightSampleWidget(IRightBodyTouch, MDIconButton): pass -class IconRightSampleWidget(IRightBodyTouch, MDCheckbox): - """Right icon sample widget""" - - pass - - class ToggleBtn(IRightBodyTouch, MDSwitch): """Right toggle button widget""" pass @@ -2132,7 +2132,7 @@ class CheckboxLeftSampleWidget(ILeftBodyTouch, MDCheckbox): pass -class MailDetail(Screen): +class MailDetail(Screen): # pylint: disable=too-many-instance-attributes """MailDetail Screen uses to show the detail of mails""" to_addr = StringProperty() @@ -2169,8 +2169,8 @@ class MailDetail(Screen): def assign_mail_details(self, data): """Assigning mail details""" - subject = data[0][2].decode() if isinstance(data[0][2],bytes) else data[0][2] - body = data[0][3].decode() if isinstance(data[0][2],bytes) else data[0][3] + subject = data[0][2].decode() if isinstance(data[0][2], bytes) else data[0][2] + body = data[0][3].decode() if isinstance(data[0][2], bytes) else data[0][3] self.to_addr = data[0][0] if len(data[0][0]) > 4 else ' ' self.from_addr = data[0][1] @@ -2180,7 +2180,7 @@ class MailDetail(Screen): if len(data[0]) == 7: self.status = data[0][4] self.time_tag = ShowTimeHistoy(data[0][4]) if state.detailPageType == 'inbox' else ShowTimeHistoy(data[0][6]) - self.avatarImg= './images/avatar.png' if state.detailPageType == 'draft' else ( + self.avatarImg = './images/avatar.png' if state.detailPageType == 'draft' else ( './images/text_images/{0}.png'.format(avatarImageFirstLetter(self.subject.strip()))) self.timeinseconds = data[0][4] if state.detailPageType == 'inbox' else data[0][6] @@ -2282,6 +2282,7 @@ class MailDetail(Screen): navApp.set_navbar_for_composer() def detailedPopup(self): + """Detailed popup""" obj = SenderDetailPopup() obj.open() arg = (self.to_addr, self.from_addr, self.timeinseconds) @@ -2313,7 +2314,7 @@ class MyaddDetailPopup(Popup): state.kivyapp.set_navbar_for_composer() try: window_obj = self.parent.children[2].ids - except Exception as e: + except Exception: window_obj = self.parent.children[1].ids window_obj.sc3.children[1].ids.ti.text = self.address window_obj.sc3.children[1].ids.btn.text = self.address @@ -2367,7 +2368,7 @@ class AddbookDetailPopup(Popup): state.kivyapp.set_navbar_for_composer() try: window_obj = self.parent.children[2].ids - except Exception as e: + except Exception: window_obj = self.parent.children[1].ids window_obj.sc3.children[1].ids.txt_input.text = self.address window_obj.sc3.children[1].ids.ti.text = '' @@ -2604,7 +2605,8 @@ class Draft(Screen): encoding, BMConfigParser().safeGetInt('bitmessagesettings', 'ttl')) state.msg_counter_objs = src_object.children[2].children[0].ids - state.draft_count = str(int(state.draft_count) + 1) if state.association == fromAddress else state.draft_count + state.draft_count = str(int(state.draft_count) + 1) \ + if state.association == fromAddress else state.draft_count src_object.ids.sc16.clear_widgets() src_object.ids.sc16.add_widget(Draft()) toast('Save draft') @@ -2688,12 +2690,12 @@ class Allmails(Screen): """This method is used to create mdList for allmaills""" data_exist = len(self.ids.ml.children) for item in self.all_mails: - body = item[3].decode() if isinstance(item[3],bytes) else item[3] - subject = item[2].decode() if isinstance(item[2],bytes) else item[2] + body = item[3].decode() if isinstance(item[3], bytes) else item[3] + subject = item[2].decode() if isinstance(item[2], bytes) else item[2] meny = TwoLineAvatarIconListItem( text=item[1], secondary_text=(subject[:50] + '........' if len( - subject) >= 50 else ( + subject) >= 50 else ( subject + ',' + body)[0:50] + '........').replace('\t', '').replace(' ', ''), theme_text_color='Custom', text_color=NavigateApp().theme_cls.primary_color) @@ -2864,6 +2866,7 @@ class NavigationItem(OneLineAvatarIconListItem): active = BooleanProperty(False) def currentlyActive(self): + """Currenly active""" for nav_obj in self.parent.children: nav_obj.active = False self.active = True @@ -2927,22 +2930,23 @@ class SenderDetailPopup(Popup): super(SenderDetailPopup, self).__init__(**kwargs) def assignDetail(self, to_addr, from_addr, timeinseconds): + """Detailes assigned""" self.to_addr = to_addr self.from_addr = from_addr time_obj = datetime.fromtimestamp(int(timeinseconds)) self.time_tag = time_obj.strftime("%d %b %Y, %I:%M %p") - pop_height = 1.2*(self.ids.sd_label.height+self.ids.sd_btn.children[0].height) + pop_height = 1.2 * (self.ids.sd_label.height + self.ids.sd_btn.children[0].height) if len(to_addr) > 3: self.height = 0 self.height = pop_height self.ids.to_addId.size_hint_y = None - self.ids.to_addId.height= 50 + self.ids.to_addId.height = 50 frmaddbox = ToAddrBoxlayout() frmaddbox.set_toAddress(to_addr) self.ids.to_addId.add_widget(frmaddbox) else: self.height = 0 - self.height = pop_height/1.5 + self.height = pop_height / 1.5 class OneLineListTitle(OneLineListItem): @@ -2951,6 +2955,7 @@ class OneLineListTitle(OneLineListItem): long_press_time = NumericProperty(1) def on_state(self, instance, value): + """On state""" if value == 'down': lpt = self.long_press_time self._clockev = Clock.schedule_once(self._do_long_press, lpt) @@ -2958,9 +2963,11 @@ class OneLineListTitle(OneLineListItem): self._clockev.cancel() def _do_long_press(self, dt): + """Do long press""" self.dispatch('on_long_press') def on_long_press(self, *largs): + """On long press""" self.copymessageTitle(self.text) def copymessageTitle(self, text): @@ -2995,4 +3002,5 @@ class PaymentMethods(Screen): """PaymentMethods Screen show widgets of page""" def redirect_on_web(self, instance): + """Redirect on web""" pass diff --git a/src/bmconfigparser.py b/src/bmconfigparser.py index d2d9010d..5431d0b8 100644 --- a/src/bmconfigparser.py +++ b/src/bmconfigparser.py @@ -3,7 +3,6 @@ BMConfigParser class definition and default configuration settings """ # pylint: disable=no-self-use, arguments-differ import configparser -import shutil import os import shutil from datetime import datetime diff --git a/src/class_objectProcessor.py b/src/class_objectProcessor.py index edfef77b..e91add6e 100644 --- a/src/class_objectProcessor.py +++ b/src/class_objectProcessor.py @@ -439,8 +439,8 @@ class objectProcessor(threading.Thread): return # Let us try to decrypt the pubkey - toAddress, _ = state.neededPubkeys[bytes(tag)] #check with py2 - if protocol.decryptAndCheckPubkeyPayload(bytes(data), toAddress) == \ + toAddress, _ = state.neededPubkeys[bytes(tag)] # check with py2 + if protocol.decryptAndCheckPubkeyPayload(bytes(data), toAddress) == \ 'successful': # At this point we know that we have been waiting on this # pubkey. This function will command the workerThread diff --git a/src/class_singleWorker.py b/src/class_singleWorker.py index 26c16809..e1959796 100644 --- a/src/class_singleWorker.py +++ b/src/class_singleWorker.py @@ -873,7 +873,7 @@ class singleWorker(StoppableThread): tr._translate( "MainWindow", "Looking up the receiver\'s public key")) - )) + )) self.logger.info('Sending a message.') # self.logger.debug( # 'First 150 characters of message: %s', @@ -883,13 +883,13 @@ class singleWorker(StoppableThread): # Let us fetch the recipient's public key out of # our database. If the required proof of work difficulty # is too hard then we'll abort. - + queryreturn = sqlQuery( 'SELECT transmitdata FROM pubkeys WHERE address=?', toaddress) for row in queryreturn: # pylint: disable=redefined-outer-name pubkeyPayload, = row - + # The pubkey message is stored with the following items # all appended: # -address version @@ -913,7 +913,7 @@ class singleWorker(StoppableThread): # if receiver is a mobile device who expects that their # address RIPE is included unencrypted on the front of - # the message.. + # the message.. if protocol.isBitSetWithinBitfield(behaviorBitfield, 30): # if we are Not willing to include the receiver's # RIPE hash on the message.. @@ -951,7 +951,7 @@ class singleWorker(StoppableThread): readPosition:readPosition + 64] readPosition += 64 # Let us fetch the amount of work required by the recipient. - if toAddressVersionNumber == 2: + if toAddressVersionNumber == 2: requiredAverageProofOfWorkNonceTrialsPerByte = \ defaults.networkDefaultProofOfWorkNonceTrialsPerByte requiredPayloadLengthExtraBytes = \ @@ -965,7 +965,7 @@ class singleWorker(StoppableThread): "There is no required difficulty for" " version 2 addresses like this.")) )) - + elif toAddressVersionNumber >= 3: requiredAverageProofOfWorkNonceTrialsPerByte, \ varintLength = decodeVarint( @@ -1158,7 +1158,7 @@ class singleWorker(StoppableThread): fullAckPayload = self.generateFullAckMessage( ackdata, toStreamNumber, TTL) payload += encodeVarint(len(fullAckPayload)) - payload += fullAckPayload if isinstance(fullAckPayload,bytes) else fullAckPayload.encode() + payload += fullAckPayload if isinstance(fullAckPayload, bytes) else fullAckPayload.encode() dataToSign = pack('>Q', embeddedTime) + '\x00\x00\x00\x02'.encode() + \ encodeVarint(1) + encodeVarint(toStreamNumber) + payload signature = highlevelcrypto.sign(dataToSign, privSigningKeyHex) @@ -1201,11 +1201,11 @@ class singleWorker(StoppableThread): self.logger.info( '(For msg message) Doing proof of work. Total required' ' difficulty: {}. Required small message difficulty: {}.'.format - (float(requiredAverageProofOfWorkNonceTrialsPerByte) / - defaults.networkDefaultProofOfWorkNonceTrialsPerByte, - float(requiredPayloadLengthExtraBytes) / - defaults.networkDefaultPayloadLengthExtraBytes) - ) + ( + float(requiredAverageProofOfWorkNonceTrialsPerByte) / + defaults.networkDefaultProofOfWorkNonceTrialsPerByte, + float(requiredPayloadLengthExtraBytes) / + defaults.networkDefaultPayloadLengthExtraBytes)) powStartTime = time.time() initialHash = hashlib.sha512(encryptedPayload).digest() @@ -1332,9 +1332,9 @@ class singleWorker(StoppableThread): ) return retryNumber = queryReturn[0][0] - if addressVersionNumber <= 3: + if addressVersionNumber <= 3: state.neededPubkeys[toAddress] = 0 - elif addressVersionNumber >= 4: + elif addressVersionNumber >= 4: # If the user just clicked 'send' then the tag # (and other information) will already be in the # neededPubkeys dictionary. But if we are recovering diff --git a/src/helper_msgcoding.py b/src/helper_msgcoding.py index 70f6ad2e..904c6fe5 100644 --- a/src/helper_msgcoding.py +++ b/src/helper_msgcoding.py @@ -2,7 +2,6 @@ Message encoding end decoding functions """ -import string import zlib import messagetypes diff --git a/src/inventory.py b/src/inventory.py index d0c0a829..c3772211 100644 --- a/src/inventory.py +++ b/src/inventory.py @@ -8,7 +8,7 @@ from singleton import Singleton @Singleton -class Inventory(): +class Inventory(object): """ Inventory singleton class which uses storage backends to manage the inventory. diff --git a/src/messagetypes/message.py b/src/messagetypes/message.py index 2480df70..62f370fb 100644 --- a/src/messagetypes/message.py +++ b/src/messagetypes/message.py @@ -15,7 +15,7 @@ class Message(MsgBase): # UTF-8 and variable type validator if isinstance(data["subject"], str): # Unicode is depreciated - self.subject =data["subject"] + self.subject = data["subject"] else: # Unicode is depreciated self.subject = str(data["subject"]) diff --git a/src/network/bmobject.py b/src/network/bmobject.py index 12b997d7..7f760fa5 100644 --- a/src/network/bmobject.py +++ b/src/network/bmobject.py @@ -114,6 +114,7 @@ class BMObject(object): # pylint: disable=too-many-instance-attributes or advertise it unnecessarily) """ # if it's a stem duplicate, pretend we don't have it + # pylint: disable=protected-access if Dandelion().hasHash(self.inventoryHash): return if self.inventoryHash in Inventory(): diff --git a/src/network/bmproto.py b/src/network/bmproto.py index e4f09caf..066da94c 100644 --- a/src/network/bmproto.py +++ b/src/network/bmproto.py @@ -1,7 +1,7 @@ """ Bitmessage Protocol """ -# pylint: disable=attribute-defined-outside-init, too-few-public-methods, logging-format-interpolation +# pylint: disable=attribute-defined-outside-init,too-few-public-methods,logging-format-interpolation,protected-access import base64 import hashlib import logging @@ -31,7 +31,7 @@ from network.dandelion import Dandelion from network.proxy import ProxyError from network.objectracker import missingObjects, ObjectTracker from network.node import Node, Peer -from queues import objectProcessorQueue, portCheckerQueue, invQueue, addrQueue +from queues import objectProcessorQueue, portCheckerQueue, invQueue from network.randomtrackingdict import RandomTrackingDict logger = logging.getLogger('default') @@ -355,7 +355,7 @@ class BMProto(AdvancedDispatcher, ObjectTracker): # ignore dinv if dandelion turned off if dandelion and not state.dandelion: - return True + return True for i in map(bytes, items): if i in Inventory() and not Dandelion().hasHash(i): continue @@ -409,7 +409,7 @@ class BMProto(AdvancedDispatcher, ObjectTracker): try: self.object.checkObjectByType() objectProcessorQueue.put(( - self.object.objectType, memoryview(self.object.data))) + self.object.objectType, memoryview(self.object.data))) except BMObjectInvalidError: BMProto.stopDownloadingObject(self.object.inventoryHash, True) else: @@ -699,4 +699,4 @@ class BMStringParser(BMProto): except Exception as e: logger.debug( 'Exception of type %s while sending ACK', - type(e), exc_info=True) \ No newline at end of file + type(e), exc_info=True) diff --git a/src/network/downloadthread.py b/src/network/downloadthread.py index 323819ca..df36ccd9 100644 --- a/src/network/downloadthread.py +++ b/src/network/downloadthread.py @@ -40,7 +40,7 @@ class DownloadThread(StoppableThread): del missingObjects[i] self.lastCleaned = time.time() - def run(self): + def run(self): # pylint: disable=protected-access while not self._stopped: requested = 0 connections = BMConnectionPool().establishedConnections() diff --git a/src/network/invthread.py b/src/network/invthread.py index 1a4b7514..4d68f507 100644 --- a/src/network/invthread.py +++ b/src/network/invthread.py @@ -92,13 +92,13 @@ class InvThread(StoppableThread): connection.append_write_buf(protocol.CreatePacket( 'inv', addresses.encodeVarint( - len(fluffs)) + ('').encode().join([x for x in fluffs]))) #compare result with python2 + len(fluffs)) + ('').encode().join([x for x in fluffs]))) # compare result with python2 if stems: random.shuffle(stems) connection.append_write_buf(protocol.CreatePacket( 'dinv', addresses.encodeVarint( - len(stems)) + ('').encode().join([x for x in stems]))) #compare result with python2 + len(stems)) + ('').encode().join([x for x in stems]))) # compare result with python2 invQueue.iterate() for _ in range(len(chunk)): diff --git a/src/network/tcp.py b/src/network/tcp.py index 1d3696ed..3e566ad1 100644 --- a/src/network/tcp.py +++ b/src/network/tcp.py @@ -1,7 +1,7 @@ """ TCP protocol handler """ -# pylint: disable=too-many-ancestors +# pylint: disable=too-many-ancestors, protected-access import logging import math import random @@ -428,4 +428,4 @@ class TCPServer(AdvancedDispatcher): connectionpool.BMConnectionPool().addConnection( TCPConnection(sock=sock)) except socket.error: - pass \ No newline at end of file + pass diff --git a/src/proofofwork.py b/src/proofofwork.py index 945eb7ec..6bd4bea9 100644 --- a/src/proofofwork.py +++ b/src/proofofwork.py @@ -108,7 +108,6 @@ def _doFastPoW(target, initialHash): logger.debug("Fast PoW done") return result[0], result[1] time.sleep(0.2) - def _doCPoW(target, initialHash): diff --git a/src/protocol.py b/src/protocol.py index a213d9ec..53223b3c 100644 --- a/src/protocol.py +++ b/src/protocol.py @@ -289,7 +289,7 @@ def isProofOfWorkSufficient( def CreatePacket(command, payload=''): """Construct and return a number of bytes from a payload""" - payload = payload if type(payload) in [bytes, bytearray,memoryview] else payload.encode() + payload = payload if type(payload) in [bytes, bytearray, memoryview] else payload.encode() payload_length = len(payload) checksum = hashlib.sha512(payload).digest()[0:4] byte = bytearray(Header.size + payload_length) diff --git a/src/shared.py b/src/shared.py index 33bfa388..d84e7be6 100644 --- a/src/shared.py +++ b/src/shared.py @@ -25,7 +25,6 @@ from addresses import decodeAddress, encodeVarint from bmconfigparser import BMConfigParser from debug import logger from helper_sql import sqlQuery -from pyelliptic import arithmetic # pylint: disable=logging-format-interpolation verbose = 1 diff --git a/src/storage/sqlite.py b/src/storage/sqlite.py index 71d70488..002694d5 100644 --- a/src/storage/sqlite.py +++ b/src/storage/sqlite.py @@ -39,11 +39,11 @@ class SqliteInventory(InventoryStorage): # pylint: disable=too-many-ancestors return False self._objects[hash_] = rows[0][0] return True - + def __getitem__(self, hash_): with self.lock: - if isinstance(hash_,memoryview) and bytes(hash_) in self._inventory : - return self._inventory[bytes(hash_)] + if isinstance(hash_, memoryview) and bytes(hash_) in self._inventory: + return self._inventory[bytes(hash_)] else: if hash_ in self._inventory: return self._inventory[hash_] @@ -52,7 +52,7 @@ class SqliteInventory(InventoryStorage): # pylint: disable=too-many-ancestors ' FROM inventory WHERE hash=?', sqlite3.Binary(hash_)) if not rows: raise KeyError(hash_) - return InventoryItem(*rows[0]) + return InventoryItem(*rows[0]) def __setitem__(self, hash_, value): with self.lock: From c25ef395ad96082ef14dd5afbbd8ef94baccea9a Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Wed, 18 Mar 2020 16:21:18 +0530 Subject: [PATCH 6/8] mpybit fixes --- src/bitmessagekivy/mpybit.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/bitmessagekivy/mpybit.py b/src/bitmessagekivy/mpybit.py index eb790b08..f5dcebe4 100644 --- a/src/bitmessagekivy/mpybit.py +++ b/src/bitmessagekivy/mpybit.py @@ -398,11 +398,10 @@ class MyAddress(Screen): meny = CustomTwoLineAvatarIconListItem( text=item['text'], secondary_text=item['secondary_text'], theme_text_color='Custom' if is_enable == 'true' else 'Primary', - text_color=NavigateApp().theme_cls.primary_color, - ) + text_color=NavigateApp().theme_cls.primary_color,) try: meny.canvas.children[6].rgba = [0, 0, 0, 0] if is_enable == 'true' else [0.5, 0.5, 0.5, 0.5] - except Exception as e: + except Exception: meny.canvas.children[9].rgba = [0, 0, 0, 0] if is_enable == 'true' else [0.5, 0.5, 0.5, 0.5] meny.add_widget(AvatarSampleWidget( source='./images/text_images/{}.png'.format( @@ -508,7 +507,7 @@ class MyAddress(Screen): instance.parent.parent.theme_text_color = 'Primary' try: instance.parent.parent.canvas.children[6].rgba = [0.5, 0.5, 0.5, 0.5] - except Exception as e: + except Exception: instance.parent.parent.canvas.children[9].rgba = [0.5, 0.5, 0.5, 0.5] toast('Address disabled') Clock.schedule_once(self.address_permision_callback, 0) @@ -520,7 +519,7 @@ class MyAddress(Screen): instance.parent.parent.theme_text_color = 'Custom' try: instance.parent.parent.canvas.children[6].rgba = [0, 0, 0, 0] - except Exception as e: + except Exception: instance.parent.parent.canvas.children[9].rgba = [0, 0, 0, 0] toast('Address Enabled') Clock.schedule_once(self.address_permision_callback, 0) @@ -1136,7 +1135,7 @@ class Sent(Screen): self.loadSent() if state.association == state.check_sent_acc: total_sent = int(state.sent_count) + 1 - state.sent_count = str(int(state.sent_count) +1) + state.sent_count = str(int(state.sent_count) + 1) self.set_sentCount(total_sent) else: total_sent = int(state.sent_count) @@ -1145,7 +1144,7 @@ class Sent(Screen): self.sentDataQuery('fromaddress', '', '', 0, 1) if state.association == state.check_sent_acc: total_sent = int(state.sent_count) + 1 - state.sent_count = str(int(state.sent_count) +1) + state.sent_count = str(int(state.sent_count) + 1) self.set_sentCount(total_sent) else: total_sent = int(state.sent_count) @@ -2254,11 +2253,13 @@ class MailDetail(Screen): # pylint: disable=too-many-instance-attributes composer_obj.btn.text = data[0][0] composer_obj.txt_input.text = data[0][1] split_subject = data[0][2].split('Re:', 1) - composer_obj.subject.text = 'Re: ' +(split_subject[1] if len(split_subject)>1 else split_subject[0]) + composer_obj.subject.text = 'Re: ' + (split_subject[1] if len(split_subject) > 1 else split_subject[0]) time_obj = datetime.fromtimestamp(int(data[0][4])) time_tag = time_obj.strftime("%d %b %Y, %I:%M %p") sender_name = BMConfigParser().get(data[0][1], 'label') - composer_obj.body.text = '\n\n ------------------------On '+time_tag+', '+sender_name+' wrote:-----------------------\n' + data[0][3] + composer_obj.body.text = ( + '\n\n ------------------------On ' + time_tag + ', ' + + sender_name + ' wrote:-----------------------\n' + data[0][3]) composer_obj.body.focus = True composer_obj.body.cursor = (0, 0) state.kivyapp.root.ids.sc3.children[1].ids.rv.data = '' From a7e8990afe0ccda7d17e3ba23b28a0e685f3a701 Mon Sep 17 00:00:00 2001 From: navjot Date: Wed, 18 Mar 2020 18:30:45 +0530 Subject: [PATCH 7/8] removed payment method Screen --- src/bitmessagekivy/kv/payment.kv | 4 +- src/bitmessagekivy/kv/payment_method.kv | 57 ------------------------- src/bitmessagekivy/main.kv | 2 - src/bitmessagekivy/mpybit.py | 15 ++----- 4 files changed, 4 insertions(+), 74 deletions(-) delete mode 100644 src/bitmessagekivy/kv/payment_method.kv diff --git a/src/bitmessagekivy/kv/payment.kv b/src/bitmessagekivy/kv/payment.kv index 0d14e2ca..9223c4ed 100644 --- a/src/bitmessagekivy/kv/payment.kv +++ b/src/bitmessagekivy/kv/payment.kv @@ -47,7 +47,7 @@ size: self.size size: dp(app.window_size[0] - 2*self.parent.parent.padding[0]) - 10 , 1 height: dp(40) - on_press: root.get_available_credits(self) + on_press: root.get_free_credits(self) MDLabel: font_style: 'H6' text: 'Get Free Credits' @@ -93,7 +93,6 @@ size: self.size size: dp(app.window_size[0] - 2*self.parent.parent.padding[0]) - 10 , 1 height: dp(40) - on_press: app.root.ids.scr_mngr.current = 'pay-options' on_press: root.move_to_pay_option(py2.text) MDLabel: font_style: 'H6' @@ -140,7 +139,6 @@ size: self.size size: dp(app.window_size[0] - 2*self.parent.parent.padding[0]) - 10 , 1 height: dp(40) - on_press: app.root.ids.scr_mngr.current = 'pay-options' on_press: root.move_to_pay_option(py3.text) MDLabel: font_style: 'H6' diff --git a/src/bitmessagekivy/kv/payment_method.kv b/src/bitmessagekivy/kv/payment_method.kv deleted file mode 100644 index f304d00c..00000000 --- a/src/bitmessagekivy/kv/payment_method.kv +++ /dev/null @@ -1,57 +0,0 @@ -: - name: 'pay-options' - ScrollView: - do_scroll_x: False - BoxLayout: - # canvas.before: - # Color: - # rgba: .5,.5,.5,.5 - # Rectangle: - # pos: self.pos - # size: self.size - orientation: 'vertical' - padding: [self.width/4, 20, self.width/4, 20] - size_hint_y: None - spacing: 20 - height: self.minimum_height - # GridLayout: - # cols: 1 - # rows: 3 - # size_hint_y: None - # # height: self.minimum_height - # # padding: dp(10), dp(10) - # spacing: dp(10) - SmartTileWithLabel: - # size_hint_y: None - size_hint: (None, None) - # pos_hint: {'x': .5, 'y': .5} - height: 180 - width: 400 - id: tile_2 - mipmap: True - source: './images/paymode/download.png' - # text: "[size=12]Paypal[/size]" - on_press: root.redirect_on_web(self) - font_style: 'Subtitle1' - SmartTileWithLabel: - # size_hint_y: None - size_hint: (None, None) - height: 180 - width: 400 - id: tile_2 - mipmap: True - # text: "[size=12]Crypto wallet[/size]" - font_style: 'Subtitle1' - source: './images/paymode/bitcoin-logo.jpg' - on_press: root.redirect_on_web(self) - SmartTileWithLabel: - # size_hint_y: None - size_hint: (None, None) - height: 180 - width: 400 - id: tile_2 - mipmap: True - # text: "[size=12]Googgle in app[/size]" - font_style: 'Subtitle1' - source: './images/paymode/111.webp' - on_press: root.redirect_on_web(self) \ No newline at end of file diff --git a/src/bitmessagekivy/main.kv b/src/bitmessagekivy/main.kv index 92889b31..0e6ec253 100644 --- a/src/bitmessagekivy/main.kv +++ b/src/bitmessagekivy/main.kv @@ -259,8 +259,6 @@ NavigationLayout: id:sc19 Archieve: id:sc20 - PaymentMethods: - id:sc21 MDNavigationDrawer: id: nav_drawer diff --git a/src/bitmessagekivy/mpybit.py b/src/bitmessagekivy/mpybit.py index f5dcebe4..8da4314c 100644 --- a/src/bitmessagekivy/mpybit.py +++ b/src/bitmessagekivy/mpybit.py @@ -73,8 +73,7 @@ KVFILES = [ 'settings', 'popup', 'allmails', 'draft', 'maildetail', 'common_widgets', 'addressbook', 'myaddress', 'composer', 'payment', 'sent', - 'network', 'login', 'credits', 'trash', 'inbox', - 'payment_method' + 'network', 'login', 'credits', 'trash', 'inbox' ] @@ -878,7 +877,7 @@ class MyTextInput(TextInput): class Payment(Screen): """Payment module""" - def get_available_credits(self, instance): + def get_free_credits(self, instance): """Get the available credits""" # pylint: disable=no-self-use state.availabe_credit = instance.parent.children[1].text @@ -894,7 +893,7 @@ class Payment(Screen): def move_to_pay_option(self, amount): # pylint: disable=no-self-use """Option move to pay""" - state.kivyapp.set_toolbar_for_QrCode() + pass class Credits(Screen): @@ -2997,11 +2996,3 @@ class ToAddrBoxlayout(BoxLayout): def set_toAddress(self, to_addr): """This method is use to set to address""" self.to_addr = to_addr - - -class PaymentMethods(Screen): - """PaymentMethods Screen show widgets of page""" - - def redirect_on_web(self, instance): - """Redirect on web""" - pass From 948ee91e04cfdd853b904ef47b94d4a8bffbeb33 Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Wed, 18 Mar 2020 19:30:27 +0530 Subject: [PATCH 8/8] quality fixes after inventory issue resolve --- src/class_singleWorker.py | 7 ++++--- src/inventory.py | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/class_singleWorker.py b/src/class_singleWorker.py index e1959796..2c28cf9b 100644 --- a/src/class_singleWorker.py +++ b/src/class_singleWorker.py @@ -1,7 +1,7 @@ """ Thread for performing PoW """ -# pylint: disable=protected-access,too-many-branches,too-many-statements +# pylint: disable=protected-access,too-many-branches,too-many-statements,unused-variable # pylint: disable=no-self-use,too-many-lines,too-many-locals,relative-import @@ -477,6 +477,7 @@ class singleWorker(StoppableThread): def sendOnionPeerObj(self, peer=None): """Send onionpeer object representing peer""" + # pylint: disable=redefined-argument-from-local if not peer: # find own onionhostname for peer in state.ownAddresses: if peer.host.endswith('.onion'): @@ -684,7 +685,7 @@ class singleWorker(StoppableThread): def sendMsg(self): """Send a message-type object (assemble the object, perform PoW and put it to the inv announcement queue)""" - # pylint: disable=too-many-nested-blocks + # pylint: disable=too-many-nested-blocks,logging-format-interpolation,unused-variable # Reset just in case sqlExecute( '''UPDATE sent SET status='msgqueued' ''' @@ -1238,7 +1239,7 @@ class singleWorker(StoppableThread): inventoryHash = calculateInventoryHash(encryptedPayload) objectType = 2 inventoryHashlist = ( - objectType, toStreamNumber,encryptedPayload, embeddedTime, '') + objectType, toStreamNumber, encryptedPayload, embeddedTime, '') Inventory()[inventoryHash] = ( objectType, toStreamNumber, encryptedPayload, embeddedTime, '') if BMConfigParser().has_section(toaddress) or \ diff --git a/src/inventory.py b/src/inventory.py index c3772211..abcc57d2 100644 --- a/src/inventory.py +++ b/src/inventory.py @@ -43,8 +43,8 @@ class Inventory(object): # on python3 we have separately added __setitem__ method def __setitem__(self, hash_, value): - return getattr(self._realInventory,'__setitem__')(hash_,value) + return getattr(self._realInventory, '__setitem__')(hash_, value) # hint for pylint: this is dictionary like object def __getitem__(self, key): - return self._realInventory[key] \ No newline at end of file + return self._realInventory[key]