Merge pull request #66 from jaicis/Chatroom

worked on making python3 android app compitable
This commit is contained in:
navjotcis 2020-05-12 16:49:10 +05:30 committed by GitHub
commit 3940e24fb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 341 additions and 210 deletions

View File

@ -5,7 +5,7 @@
orientation: 'vertical' orientation: 'vertical'
size_hint_y: None size_hint_y: None
height: self.minimum_height + 2 * self.parent.height/4 height: self.minimum_height + 2 * self.parent.height/4
padding: dp(32) padding: dp(20)
spacing: 15 spacing: 15
BoxLayout: BoxLayout:
orientation: 'vertical' orientation: 'vertical'
@ -14,7 +14,7 @@
hint_text: 'type or select sender address' hint_text: 'type or select sender address'
size_hint_y: None size_hint_y: None
height: 100 height: 100
font_size: '15sp' font_size: dp(15)
multiline: False multiline: False
required: True required: True
helper_text_mode: "on_error" helper_text_mode: "on_error"

View File

@ -5,7 +5,7 @@
BoxLayout: BoxLayout:
orientation: 'vertical' orientation: 'vertical'
size_hint_y: None size_hint_y: None
height: dp(400) + self.minimum_height height: dp(450) + self.minimum_height
padding: dp(10) padding: dp(10)
BoxLayout: BoxLayout:
MDLabel: MDLabel:
@ -21,6 +21,9 @@
text: root.log_text2 text: root.log_text2
halign: 'left' halign: 'left'
color:app.theme_cls.primary_dark color:app.theme_cls.primary_dark
Widget:
size_hint: (None, None)
height: dp(10)
MDCheckbox: MDCheckbox:
id: grp_chkbox_1 id: grp_chkbox_1
group: 'test' group: 'test'
@ -55,7 +58,8 @@
BoxLayout: BoxLayout:
AnchorLayout: AnchorLayout:
MDRaisedButton: MDRaisedButton:
height: dp(40) size_hint: (.2, None)
# height: dp(40)
on_press: app.root.ids.scr_mngr.current = 'random' on_press: app.root.ids.scr_mngr.current = 'random'
on_press: app.root.ids.sc7.reset_address_label() on_press: app.root.ids.sc7.reset_address_label()
MDLabel: MDLabel:
@ -87,7 +91,7 @@
font_style: 'Subtitle2' font_style: 'Subtitle2'
theme_text_color: 'Primary' theme_text_color: 'Primary'
text: "Here you may generate as many addresses as you like, Indeed creating and abandoning addresses is encouraged" text: "Here you may generate as many addresses as you like, Indeed creating and abandoning addresses is encouraged"
halign: 'center' halign: 'left'
color:app.theme_cls.primary_dark color:app.theme_cls.primary_dark
MDTextField: MDTextField:
@ -104,7 +108,8 @@
BoxLayout: BoxLayout:
AnchorLayout: AnchorLayout:
MDRaisedButton: MDRaisedButton:
height: dp(40) size_hint: (.2, None)
# height: dp(40)
on_release: app.root.ids.sc7.generateaddress(app) on_release: app.root.ids.sc7.generateaddress(app)
opposite_colors: True opposite_colors: True
MDLabel: MDLabel:

View File

@ -7,7 +7,7 @@
orientation: 'vertical' orientation: 'vertical'
# height: dp(bod.height) + self.minimum_height # height: dp(bod.height) + self.minimum_height
height: self.minimum_height height: self.minimum_height
padding: dp(20) padding: dp(10)
# MDLabel: # MDLabel:
# size_hint_y: None # size_hint_y: None
# id: subj # id: subj
@ -36,6 +36,7 @@
halign:'right' halign:'right'
font_style:'Caption' font_style:'Caption'
pos_hint: {'center_y': .8} pos_hint: {'center_y': .8}
_txt_right_pad: dp(70)
MDChip: MDChip:
size_hint: (None, None) size_hint: (None, None)
label: root.page_type label: root.page_type

View File

@ -19,12 +19,18 @@
size_hint_y: None size_hint_y: None
height: dp(58) height: dp(58)
MDRaisedButton: MDRaisedButton:
size_hint: .5, 0 size_hint: .6, 0
height: dp(40) height: dp(40)
text: root.text_variable_1 # text: root.text_variable_1
elevation_normal: 2 elevation_normal: 2
opposite_colors: True opposite_colors: True
pos_hint: {'center_x': .5} pos_hint: {'center_x': .5}
MDLabel:
font_style: 'H6'
text: root.text_variable_1
font_size: '13sp'
color: (1,1,1,1)
halign: 'center'
Tab: Tab:
text: 'Processes' text: 'Processes'
ScrollView: ScrollView:
@ -40,12 +46,18 @@
size_hint_y: None size_hint_y: None
height: dp(58) height: dp(58)
MDRaisedButton: MDRaisedButton:
size_hint: .5, 0 size_hint: .6, 0
height: dp(40) height: dp(40)
text: root.text_variable_2 # text: root.text_variable_2
elevation_normal: 2 elevation_normal: 2
opposite_colors: True opposite_colors: True
pos_hint: {'center_x': .5} pos_hint: {'center_x': .5}
MDLabel:
font_style: 'H6'
text: root.text_variable_2
font_size: '13sp'
color: (1,1,1,1)
halign: 'center'
OneLineListItem: OneLineListItem:
text: "Brodcast" text: "Brodcast"
BoxLayout: BoxLayout:
@ -53,12 +65,18 @@
size_hint_y: None size_hint_y: None
height: dp(58) height: dp(58)
MDRaisedButton: MDRaisedButton:
size_hint: .5, 0 size_hint: .6, 0
height: dp(40) height: dp(40)
text: root.text_variable_3 # text: root.text_variable_3
elevation_normal: 2 elevation_normal: 2
opposite_colors: True opposite_colors: True
pos_hint: {'center_x': .5} pos_hint: {'center_x': .5}
MDLabel:
font_style: 'H6'
text: root.text_variable_3
font_size: '13sp'
color: (1,1,1,1)
halign: 'center'
OneLineListItem: OneLineListItem:
text: "publickeys" text: "publickeys"
BoxLayout: BoxLayout:
@ -66,12 +84,18 @@
size_hint_y: None size_hint_y: None
height: dp(58) height: dp(58)
MDRaisedButton: MDRaisedButton:
size_hint: .5, 0 size_hint: .6, 0
height: dp(40) height: dp(40)
text: root.text_variable_4 # text: root.text_variable_4
elevation_normal: 2 elevation_normal: 2
opposite_colors: True opposite_colors: True
pos_hint: {'center_x': .5} pos_hint: {'center_x': .5}
MDLabel:
font_style: 'H6'
text: root.text_variable_4
font_size: '13sp'
color: (1,1,1,1)
halign: 'center'
OneLineListItem: OneLineListItem:
text: "objects" text: "objects"
BoxLayout: BoxLayout:
@ -79,9 +103,15 @@
size_hint_y: None size_hint_y: None
height: dp(58) height: dp(58)
MDRaisedButton: MDRaisedButton:
size_hint: .5, 0 size_hint: .6, 0
height: dp(40) height: dp(40)
text: root.text_variable_5 # text: root.text_variable_5
elevation_normal: 2 elevation_normal: 2
opposite_colors: True opposite_colors: True
pos_hint: {'center_x': .5} pos_hint: {'center_x': .5}
MDLabel:
font_style: 'H6'
text: root.text_variable_5
font_size: '13sp'
color: (1,1,1,1)
halign: 'center'

View File

@ -45,7 +45,7 @@
Rectangle: Rectangle:
pos: self.pos pos: self.pos
size: self.size size: self.size
size: dp(app.window_size[0] - 2*self.parent.parent.padding[0]) - 10 , 1 size: app.window_size[0] - 2*self.parent.parent.padding[0] - dp(10) , 1
height: dp(40) height: dp(40)
on_press: root.get_free_credits(self) on_press: root.get_free_credits(self)
MDLabel: MDLabel:
@ -91,7 +91,7 @@
Rectangle: Rectangle:
pos: self.pos pos: self.pos
size: self.size size: self.size
size: dp(app.window_size[0] - 2*self.parent.parent.padding[0]) - 10 , 1 size: app.window_size[0] - 2*self.parent.parent.padding[0] - dp(10) , 1
height: dp(40) height: dp(40)
on_press: root.create_hidden_payment_address(self) on_press: root.create_hidden_payment_address(self)
MDLabel: MDLabel:
@ -137,7 +137,7 @@
Rectangle: Rectangle:
pos: self.pos pos: self.pos
size: self.size size: self.size
size: dp(app.window_size[0] - 2*self.parent.parent.padding[0]) - 10 , 1 size: app.window_size[0] - 2*self.parent.parent.padding[0] - dp(10) , 1
height: dp(40) height: dp(40)
on_press: root.create_hidden_payment_address(self) on_press: root.create_hidden_payment_address(self)
MDLabel: MDLabel:

View File

@ -338,6 +338,19 @@
id: myadd_popup_box id: myadd_popup_box
size_hint_y: None size_hint_y: None
orientation: 'vertical' orientation: 'vertical'
spacing:dp(8 if app.app_platform == 'android' else 3)
BoxLayout:
orientation: 'vertical'
MDLabel:
id: from_add_label
font_style: 'Subtitle2'
theme_text_color: 'Primary'
text: "From :"
font_size: '15sp'
halign: 'left'
Widget:
size_hint_y: None
height: dp(1 if app.app_platform == 'android' else 0)
BoxLayout: BoxLayout:
size_hint_y: None size_hint_y: None
height: 50 height: 50
@ -346,13 +359,23 @@
id: sd_label id: sd_label
font_style: 'Body2' font_style: 'Body2'
theme_text_color: 'Primary' theme_text_color: 'Primary'
text: "From : [b]" + root.from_addr + "[/b]" text: "[b]" + root.from_addr + "[/b]"
font_size: '15sp' font_size: '15sp'
halign: 'left' halign: 'left'
markup: True markup: True
IconRightSampleWidget: IconRightSampleWidget:
icon: 'content-copy' icon: 'content-copy'
on_press: app.copy_composer_text(root.from_addr) on_press: app.copy_composer_text(root.from_addr)
Widget:
id: space_1
size_hint_y: None
height: dp(2 if app.app_platform == 'android' else 0)
BoxLayout:
id: to_addtitle
Widget:
id:space_2
size_hint_y: None
height: dp(1 if app.app_platform == 'android' else 0)
BoxLayout: BoxLayout:
id: to_addId id: to_addId
BoxLayout: BoxLayout:
@ -370,7 +393,8 @@
orientation: 'vertical' orientation: 'vertical'
MDRaisedButton: MDRaisedButton:
on_press: root.dismiss() on_press: root.dismiss()
pos_hint: {'x': 0.85, 'y': 0} size_hint: .2, 0
pos_hint: {'x': 0.8, 'y': 0}
MDLabel: MDLabel:
font_style: 'H6' font_style: 'H6'
text: 'Cancel' text: 'Cancel'
@ -383,9 +407,19 @@
MDLabel: MDLabel:
font_style: 'Body2' font_style: 'Body2'
theme_text_color: 'Primary' theme_text_color: 'Primary'
text: "To : " + root.to_addr text: root.to_addr
font_size: '15sp' font_size: '15sp'
halign: 'left' halign: 'left'
IconRightSampleWidget: IconRightSampleWidget:
icon: 'content-copy' icon: 'content-copy'
on_press: app.copy_composer_text(root.to_addr) on_press: app.copy_composer_text(root.to_addr)
<ToAddressTitle>:
orientation: 'vertical'
MDLabel:
id: to_add_label
font_style: 'Subtitle2'
theme_text_color: 'Primary'
text: "To :"
font_size: '15sp'
halign: 'left'

View File

@ -11,10 +11,12 @@
BoxLayout: BoxLayout:
size_hint_y: None size_hint_y: None
orientation: 'vertical' orientation: 'vertical'
height: dp(400) + self.minimum_height height: dp(250) + self.minimum_height
padding: 10 padding: 10
BoxLayout: BoxLayout:
size_hint_y: None
orientation: 'horizontal' orientation: 'horizontal'
height: self.minimum_height
MDCheckbox: MDCheckbox:
id: chkbox id: chkbox
size_hint: None, None size_hint: None, None
@ -29,23 +31,6 @@
halign: 'left' halign: 'left'
pos_hint: {'center_x': 0, 'center_y': 0.6} pos_hint: {'center_x': 0, 'center_y': 0.6}
disabled: True disabled: True
BoxLayout:
orientation: 'vertical'
padding: [0, 10, 0, 0]
spacing: 10
MDLabel:
font_style: 'Body1'
theme_text_color: 'Primary'
text: "Interface Language"
halign: 'right'
bold: True
MDDropDownItem:
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: BoxLayout:
size_hint_y: None size_hint_y: None
orientation: 'vertical' orientation: 'vertical'
@ -105,51 +90,53 @@
halign: 'left' halign: 'left'
pos_hint: {'x': 0, 'y': .5} pos_hint: {'x': 0, 'y': .5}
BoxLayout: BoxLayout:
orientation: 'horizontal' size_hint_y: None
MDCheckbox: orientation: 'vertical'
id: chkbox height: dp(100) + self.minimum_height
size_hint: None, None BoxLayout:
size: dp(48), dp(50) orientation: 'horizontal'
# active: True MDCheckbox:
halign: 'center' id: chkbox
MDLabel: size_hint: None, None
font_style: 'Body1' size: dp(48), dp(50)
theme_text_color: 'Primary' # active: True
text: "Hide connection notifications" halign: 'center'
halign: 'left' MDLabel:
pos_hint: {'x': 0, 'y': 0.1} font_style: 'Body1'
theme_text_color: 'Primary'
text: "Hide connection notifications"
halign: 'left'
pos_hint: {'x': 0, 'y': 0.2}
BoxLayout:
orientation: 'horizontal'
MDCheckbox:
id: chkbox
size_hint: None, None
size: dp(48), dp(50)
active: True
halign: 'center'
MDLabel:
font_style: 'Body1'
theme_text_color: 'Primary'
text: "Show notification when message received"
halign: 'left'
pos_hint: {'x': 0, 'y': 0.2}
BoxLayout:
orientation: 'horizontal'
MDCheckbox:
id: chkbox
size_hint: None, None
size: dp(48), dp(50)
# active: True
halign: 'center'
MDLabel:
font_style: 'Body1'
theme_text_color: 'Primary'
text: "Run in Portable Mode"
halign: 'left'
pos_hint: {'x': 0, 'y': 0.2}
BoxLayout: BoxLayout:
orientation: 'horizontal' orientation: 'vertical'
MDCheckbox:
id: chkbox
size_hint: None, None
size: dp(48), dp(50)
active: True
halign: 'center'
MDLabel:
font_style: 'Body1'
theme_text_color: 'Primary'
text: "Show notification when message received"
halign: 'left'
pos_hint: {'x': 0, 'y': 0.1}
BoxLayout:
orientation: 'horizontal'
MDCheckbox:
id: chkbox
size_hint: None, None
size: dp(48), dp(50)
# active: True
halign: 'center'
MDLabel:
font_style: 'Body1'
theme_text_color: 'Primary'
text: "Run in Portable Mode"
halign: 'left'
pos_hint: {'x': 0, 'y': 0.1}
BoxLayout:
# id: box_height
orientation: 'horizontal'
padding: 10
MDLabel: MDLabel:
font_style: 'Body1' font_style: 'Body1'
theme_text_color: 'Primary' theme_text_color: 'Primary'
@ -157,74 +144,84 @@
# text: 'huiiiii' # text: 'huiiiii'
halign: 'left' halign: 'left'
BoxLayout: BoxLayout:
orientation: 'horizontal' size_hint_y: None
MDCheckbox: orientation: 'vertical'
id: chkbox height: dp(100) + self.minimum_height
size_hint: None, None BoxLayout:
size: dp(48), dp(50) orientation: 'horizontal'
halign: 'center' MDCheckbox:
MDLabel: id: chkbox
font_style: 'Body1' size_hint: None, None
theme_text_color: 'Primary' size: dp(48), dp(50)
text: "Willingly include unencrypted destination address when sending to a mobile device" halign: 'center'
halign: 'left' MDLabel:
pos_hint: {'x': 0, 'y': 0.1} font_style: 'Body1'
BoxLayout: theme_text_color: 'Primary'
orientation: 'horizontal' text: "Willingly include unencrypted destination address when sending to a mobile device"
MDCheckbox: halign: 'left'
id: chkbox pos_hint: {'x': 0, 'y': 0.2}
size_hint: None, None BoxLayout:
size: dp(48), dp(50) orientation: 'horizontal'
active: True MDCheckbox:
halign: 'center' id: chkbox
MDLabel: size_hint: None, None
font_style: 'Body1' size: dp(48), dp(50)
theme_text_color: 'Primary' active: True
text: "Use identicons" halign: 'center'
halign: 'left' MDLabel:
pos_hint: {'x': 0, 'y': 0.1} font_style: 'Body1'
BoxLayout: theme_text_color: 'Primary'
orientation: 'horizontal' text: "Use identicons"
MDCheckbox: halign: 'left'
id: chkbox pos_hint: {'x': 0, 'y': 0.2}
size_hint: None, None BoxLayout:
size: dp(48), dp(50) orientation: 'horizontal'
halign: 'center' MDCheckbox:
MDLabel: id: chkbox
font_style: 'Body1' size_hint: None, None
theme_text_color: 'Primary' size: dp(48), dp(50)
text: "Reply below Quote" halign: 'center'
halign: 'left' MDLabel:
pos_hint: {'x': 0, 'y': 0.1} font_style: 'Body1'
theme_text_color: 'Primary'
text: "Reply below Quote"
halign: 'left'
pos_hint: {'x': 0, 'y': 0.2}
Widget: Widget:
size_hint_y: None size_hint_y: None
height: 10 height: 10
# BoxLayout: BoxLayout:
# orientation: 'vertical' size_hint_y: None
# spacing: 10 orientation: 'vertical'
# padding: 10 # padding: [0, 10, 0, 0]
spacing: 10
# MDLabel: padding: [20, 0, 0, 0]
# font_style: 'Body1' height: dp(20) + self.minimum_height
# theme_text_color: 'Primary' MDLabel:
# text: "Interface Language" font_style: 'Body1'
# halign: 'left' theme_text_color: 'Primary'
# bold: True text: "Interface Language"
# MDDropDownItem: # halign: 'right'
# id: dropdown_item bold: True
# # on_select MDDropDownItem:
# text: 'italiano' id: dropdown_item
# dropdown_max_height: 150 text: 'italiano'
# pos_hint: {'center_x': 0.1, 'center_y': 0} dropdown_max_height: 150
# items: [f"{i}" for i in ['System Setting','U.S. English','italiano','Esperanto','dansk','Deutsch','Pirate English','francais','Nederlands','norsk bokmal','polski','portugues europeu']] dropdown_bg: [1, 1, 1, 1]
# pos_hint: {'center_x': 0.5, '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: BoxLayout:
spacing:5 spacing:5
orientation: 'horizontal' orientation: 'horizontal'
pos_hint: {'x':.76} # pos_hint: {'x':.76}
MDRaisedButton: BoxLayout:
text: 'Reset' orientation: 'horizontal'
MDRaisedButton: # padding: [0, 10, 0, 0]
text: 'Ok' spacing: 10
MDRaisedButton:
text: 'Reset'
MDRaisedButton:
text: 'Ok'
Tab: Tab:
text: 'Network Settings' text: 'Network Settings'
ScrollView: ScrollView:
@ -232,7 +229,7 @@
BoxLayout: BoxLayout:
size_hint_y: None size_hint_y: None
orientation: 'vertical' orientation: 'vertical'
height: dp(550) + self.minimum_height height: dp(500) + self.minimum_height
padding: 10 padding: 10
BoxLayout: BoxLayout:
id: box_height id: box_height
@ -275,7 +272,7 @@
theme_text_color: 'Primary' theme_text_color: 'Primary'
text: "UPnP" text: "UPnP"
halign: 'left' halign: 'left'
pos_hint: {'x': 0, 'y': 0.1} pos_hint: {'x': 0, 'y': 0}
BoxLayout: BoxLayout:
orientation: 'vertical' orientation: 'vertical'
MDLabel: MDLabel:
@ -301,9 +298,11 @@
pos_hint: {'x': 0.9, 'y': 0} pos_hint: {'x': 0.9, 'y': 0}
items: [f"{i}" for i in ['System Setting','U.S. English']] items: [f"{i}" for i in ['System Setting','U.S. English']]
BoxLayout: BoxLayout:
orientation: 'horizontal' size_hint_y: None
orientation: 'vertical'
padding: [30, 0, 0, 0] padding: [30, 0, 0, 0]
spacing: 10 spacing: 10
height: dp(100) + self.minimum_height
BoxLayout: BoxLayout:
orientation: 'horizontal' orientation: 'horizontal'
MDLabel: MDLabel:
@ -337,10 +336,6 @@
hint_text: '9050' hint_text: '9050'
pos_hint: {'center_y': .5, 'center_x': .5} pos_hint: {'center_y': .5, 'center_x': .5}
input_filter: "int" input_filter: "int"
BoxLayout:
orientation: 'horizontal'
padding: [30, 0, 0, 0]
spacing: 10
BoxLayout: BoxLayout:
orientation: 'horizontal' orientation: 'horizontal'
MDLabel: MDLabel:
@ -377,7 +372,7 @@
theme_text_color: 'Primary' theme_text_color: 'Primary'
text: "Authentication" text: "Authentication"
halign: 'left' halign: 'left'
pos_hint: {'x': 0, 'y': 0.1} pos_hint: {'x': 0, 'y': 0}
BoxLayout: BoxLayout:
orientation: 'horizontal' orientation: 'horizontal'
padding: [30, 0, 0, 0] padding: [30, 0, 0, 0]
@ -392,7 +387,7 @@
theme_text_color: 'Primary' theme_text_color: 'Primary'
text: "Listen for incoming connections when using proxy" text: "Listen for incoming connections when using proxy"
halign: 'left' halign: 'left'
pos_hint: {'x': 0, 'y': 0.1} pos_hint: {'x': 0, 'y': 0}
BoxLayout: BoxLayout:
orientation: 'horizontal' orientation: 'horizontal'
padding: [30, 0, 0, 0] padding: [30, 0, 0, 0]
@ -407,7 +402,7 @@
theme_text_color: 'Primary' theme_text_color: 'Primary'
text: "Only connect to onion services(*.onion)" text: "Only connect to onion services(*.onion)"
halign: 'left' halign: 'left'
pos_hint: {'x': 0, 'y': 0.1} pos_hint: {'x': 0, 'y': 0}
BoxLayout: BoxLayout:
orientation: 'vertical' orientation: 'vertical'
MDLabel: MDLabel:
@ -417,8 +412,10 @@
halign: 'left' halign: 'left'
bold: True bold: True
BoxLayout: BoxLayout:
size_hint_y: None
orientation: 'horizontal' orientation: 'horizontal'
padding: [30, 0, 0, 0] padding: [30, 0, 0, 0]
height: dp(30) + self.minimum_height
MDLabel: MDLabel:
font_style: 'Body1' font_style: 'Body1'
theme_text_color: 'Primary' theme_text_color: 'Primary'
@ -426,13 +423,15 @@
halign: 'left' halign: 'left'
MDTextFieldRect: MDTextFieldRect:
size_hint: None, None size_hint: None, None
size: dp(app.window_size[0]/2), dp(30) size: app.window_size[0]/2, dp(30)
hint_text: '0' hint_text: '0'
pos_hint: {'center_y': .5, 'center_x': .5} pos_hint: {'center_y': .5, 'center_x': .5}
input_filter: "int" input_filter: "int"
BoxLayout: BoxLayout:
size_hint_y: None
orientation: 'horizontal' orientation: 'horizontal'
padding: [30, 0, 0, 0] padding: [30, 0, 0, 0]
height: dp(30) + self.minimum_height
MDLabel: MDLabel:
font_style: 'Body1' font_style: 'Body1'
theme_text_color: 'Primary' theme_text_color: 'Primary'
@ -440,13 +439,15 @@
halign: 'left' halign: 'left'
MDTextFieldRect: MDTextFieldRect:
size_hint: None, None size_hint: None, None
size: dp(app.window_size[0]/2), dp(30) size: app.window_size[0]/2, dp(30)
hint_text: '0' hint_text: '0'
pos_hint: {'center_y': .5, 'center_x': .5} pos_hint: {'center_y': .5, 'center_x': .5}
input_filter: "int" input_filter: "int"
BoxLayout: BoxLayout:
size_hint_y: None
orientation: 'horizontal' orientation: 'horizontal'
padding: [30, 0, 0, 0] padding: [30, 0, 0, 0]
height: dp(30) + self.minimum_height
MDLabel: MDLabel:
font_style: 'Body1' font_style: 'Body1'
theme_text_color: 'Primary' theme_text_color: 'Primary'
@ -454,14 +455,14 @@
halign: 'left' halign: 'left'
MDTextFieldRect: MDTextFieldRect:
size_hint: None, None size_hint: None, None
size: dp(app.window_size[0]/2), dp(30) size: app.window_size[0]/2, dp(30)
hint_text: '8' hint_text: '8'
pos_hint: {'center_y': .5, 'center_x': .5} pos_hint: {'center_y': .5, 'center_x': .5}
input_filter: "int" input_filter: "int"
BoxLayout: BoxLayout:
spacing:5 spacing:5
orientation: 'horizontal' orientation: 'horizontal'
pos_hint: {'x':.76} # pos_hint: {'x':.76}
MDRaisedButton: MDRaisedButton:
text: 'Reset' text: 'Reset'
MDRaisedButton: MDRaisedButton:
@ -473,28 +474,34 @@
BoxLayout: BoxLayout:
size_hint_y: None size_hint_y: None
orientation: 'vertical' orientation: 'vertical'
height: dp(200) + self.minimum_height height: dp(210 if app.app_platform == 'android' else 100)+ self.minimum_height
padding: 20 padding: 20
spacing: 10 # spacing: 10
BoxLayout: BoxLayout:
id: box_height # size_hint_y: None
id: box1_height
orientation: 'vertical' orientation: 'vertical'
# height: dp(100) + self.minimum_height
MDLabel: MDLabel:
font_style: 'Body1' font_style: 'Body1'
theme_text_color: 'Primary' theme_text_color: 'Primary'
text: root.exp_text text: root.exp_text
halign: 'left' halign: 'left'
BoxLayout: BoxLayout:
id: box_height id: box2_height
size_hint_y: None
orientation: 'vertical' orientation: 'vertical'
height: dp(30) + self.minimum_height
MDLabel: MDLabel:
font_style: 'Body1' font_style: 'Body1'
theme_text_color: 'Primary' theme_text_color: 'Primary'
text: "Leave these input fields blank for the default behavior." text: "Leave these input fields blank for the default behavior."
halign: 'left' halign: 'left'
BoxLayout: BoxLayout:
orientation: 'horizontal' size_hint_y: None
orientation: 'vertical'
padding: [10, 0, 0, 0] padding: [10, 0, 0, 0]
height: dp(50) + self.minimum_height
BoxLayout: BoxLayout:
orientation: 'horizontal' orientation: 'horizontal'
MDLabel: MDLabel:
@ -525,10 +532,12 @@
text: "months" text: "months"
halign: 'left' halign: 'left'
BoxLayout: BoxLayout:
size_hint_y: None
spacing:5 spacing:5
orientation: 'horizontal' orientation: 'horizontal'
# pos_hint: {'left': 0} # pos_hint: {'left': 0}
pos_hint: {'x':.75} # pos_hint: {'x':.75}
height: dp(50) + self.minimum_height
MDRaisedButton: MDRaisedButton:
text: 'Reset' text: 'Reset'
MDRaisedButton: MDRaisedButton:

View File

@ -98,7 +98,8 @@
text: "Accounts" text: "Accounts"
height:"35dp" height:"35dp"
NavigationItem: NavigationItem:
size: 50,50 # size: 50,50
height: dp(48)
CustomSpinner: CustomSpinner:
id: btn id: btn
pos_hint:{"x":0,"y":0} pos_hint:{"x":0,"y":0}
@ -301,7 +302,7 @@ NavigationLayout:
orientation: 'vertical' orientation: 'vertical'
size_hint: (None, None) size_hint: (None, None)
pos_hint:{'center_x': .5, 'top': 0.9} pos_hint:{'center_x': .5, 'top': 0.9}
size: (app.window_size[0]/2, app.window_size[0]/2) size: (app.window_size[0]/1.8, app.window_size[0]/1.8)
id: qr id: qr
BoxLayout: BoxLayout:
orientation: 'vertical' orientation: 'vertical'
@ -315,9 +316,9 @@ NavigationLayout:
line_color_normal: [0,0,0,0] line_color_normal: [0,0,0,0]
_current_line_color: [0,0,0,0] _current_line_color: [0,0,0,0]
line_color_focus: [0,0,0,0] line_color_focus: [0,0,0,0]
font_size: '18sp' halign: 'center'
font_size: dp(15)
bold: True bold: True
pos_hint: {'x': .26, 'y': 0.5}
# MDLabel: # MDLabel:
# size_hint_y: None # size_hint_y: None
# font_style: 'Body1' # font_style: 'Body1'

View File

@ -70,8 +70,10 @@ import state
from addresses import decodeAddress from addresses import decodeAddress
from kivy.uix.modalview import ModalView from kivy.uix.modalview import ModalView
from datetime import datetime from datetime import datetime
from kivy.config import Config
Config.set('input', 'mouse', 'mouse,multitouch_on_demand') if platform != 'android':
from kivy.config import Config
Config.set('input', 'mouse', 'mouse,multitouch_on_demand')
# pylint: disable=too-few-public-methods,too-many-arguments,attribute-defined-outside-init # pylint: disable=too-few-public-methods,too-many-arguments,attribute-defined-outside-init
KVFILES = [ KVFILES = [
@ -219,6 +221,7 @@ class Inbox(Screen):
text=item['text'], secondary_text=item['secondary_text'], text=item['text'], secondary_text=item['secondary_text'],
theme_text_color='Custom', theme_text_color='Custom',
text_color=NavigateApp().theme_cls.primary_color) text_color=NavigateApp().theme_cls.primary_color)
meny._txt_right_pad=dp(70)
meny.add_widget(AvatarSampleWidget( meny.add_widget(AvatarSampleWidget(
source='./images/text_images/{}.png'.format( source='./images/text_images/{}.png'.format(
avatarImageFirstLetter(item['secondary_text'].strip())))) avatarImageFirstLetter(item['secondary_text'].strip()))))
@ -404,6 +407,7 @@ class MyAddress(Screen):
text=item['text'], secondary_text=item['secondary_text'], text=item['text'], secondary_text=item['secondary_text'],
theme_text_color='Custom' if is_enable == 'true' else 'Primary', theme_text_color='Custom' if is_enable == 'true' else 'Primary',
text_color=NavigateApp().theme_cls.primary_color,) text_color=NavigateApp().theme_cls.primary_color,)
meny._txt_right_pad=dp(70)
try: try:
meny.canvas.children[6].rgba = [0, 0, 0, 0] if is_enable == 'true' else [0.5, 0.5, 0.5, 0.5] meny.canvas.children[6].rgba = [0, 0, 0, 0] if is_enable == 'true' else [0.5, 0.5, 0.5, 0.5]
except Exception: except Exception:
@ -414,13 +418,15 @@ class MyAddress(Screen):
meny.bind(on_press=partial( meny.bind(on_press=partial(
self.myadd_detail, item['secondary_text'], item['text'])) self.myadd_detail, item['secondary_text'], item['text']))
if state.association == item['secondary_text']: if state.association == item['secondary_text']:
meny.add_widget( badge_obj = BadgeText(
BadgeText(
size_hint=(None, None), size_hint=(None, None),
text='Active', halign='right', text='Active', halign='right',
# font_size = '50sp',
font_style='Body1', size=[50, 60], font_style='Body1', size=[50, 60],
theme_text_color='Custom', theme_text_color='Custom',
text_color=NavigateApp().theme_cls.primary_color)) text_color=NavigateApp().theme_cls.primary_color)
badge_obj.font_size = '13sp'
meny.add_widget(badge_obj)
else: 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 = Carousel(direction='right')
@ -1137,6 +1143,7 @@ class Sent(Screen):
text=item['text'], secondary_text=item['secondary_text'], text=item['text'], secondary_text=item['secondary_text'],
theme_text_color='Custom', theme_text_color='Custom',
text_color=NavigateApp().theme_cls.primary_color) text_color=NavigateApp().theme_cls.primary_color)
meny._txt_right_pad=dp(70)
meny.add_widget(AvatarSampleWidget( meny.add_widget(AvatarSampleWidget(
source='./images/text_images/{}.png'.format( source='./images/text_images/{}.png'.format(
avatarImageFirstLetter(item['secondary_text'].strip())))) avatarImageFirstLetter(item['secondary_text'].strip()))))
@ -1355,6 +1362,7 @@ class Trash(Screen):
subject) >= 50 else (subject + ',' + body)[0:50] + '........').replace('\t', '').replace(' ', ''), subject) >= 50 else (subject + ',' + body)[0:50] + '........').replace('\t', '').replace(' ', ''),
theme_text_color='Custom', theme_text_color='Custom',
text_color=NavigateApp().theme_cls.primary_color) text_color=NavigateApp().theme_cls.primary_color)
meny._txt_right_pad=dp(70)
img_latter = './images/text_images/{}.png'.format( img_latter = './images/text_images/{}.png'.format(
subject[0].upper() if (subject[0].upper() >= 'A' and subject[0].upper() <= 'Z') else '!') subject[0].upper() if (subject[0].upper() >= 'A' and subject[0].upper() <= 'Z') else '!')
meny.add_widget(AvatarSampleWidget(source=img_latter)) meny.add_widget(AvatarSampleWidget(source=img_latter))
@ -1587,10 +1595,12 @@ class NavigateApp(MDApp):
if platform == 'android': if platform == 'android':
# android_path = os.path.expanduser # android_path = os.path.expanduser
# ("~/user/0/org.test.bitapp/files/app/") # ("~/user/0/org.test.bitapp/files/app/")
android_path = os.path.join( if not os.path.exists('./images/default_identicon/{}.png'.format(
os.environ['ANDROID_PRIVATE'] + '/app/') BMConfigParser().addresses()[0])):
img.texture.save('{1}/images/default_identicon/{0}.png'.format( android_path = os.path.join(
BMConfigParser().addresses()[0], android_path)) os.environ['ANDROID_PRIVATE'] + '/app/')
img.texture.save('{1}/images/default_identicon/{0}.png'.format(
BMConfigParser().addresses()[0], android_path))
else: else:
if not os.path.exists('./images/default_identicon/{}.png'.format( if not os.path.exists('./images/default_identicon/{}.png'.format(
BMConfigParser().addresses()[0])): BMConfigParser().addresses()[0])):
@ -2018,29 +2028,56 @@ class NavigateApp(MDApp):
self.manager = ModalView(size_hint=(1, 1), auto_dismiss=False) self.manager = ModalView(size_hint=(1, 1), auto_dismiss=False)
self.file_manager = MDFileManager( self.file_manager = MDFileManager(
exit_manager=self.exit_manager, exit_manager=self.exit_manager,
select_path=self.select_path, select_path=self.select_path,
previous=False, previous=False,
ext=['.png', '.jpg'] ext=['.png', '.jpg']
) )
self.manager.add_widget(self.file_manager) self.manager.add_widget(self.file_manager)
self.file_manager.show(os.environ["HOME"]) # self.file_manager.show(os.environ["HOME"])
if platform == 'android':
from android.permissions import request_permissions, Permission
request_permissions([Permission.WRITE_EXTERNAL_STORAGE, Permission.READ_EXTERNAL_STORAGE])
# from android.storage import app_storage_path
# settings_path = app_storage_path()
# print('path1................................', settings_path)
# from android.storage import primary_external_storage_path
# primary_ext_storage = primary_external_storage_path()
# print('path1................................', primary_ext_storage)
# from android.storage import secondary_external_storage_path
# secondary_ext_storage = secondary_external_storage_path()
# print('path1................................', secondary_ext_storage)
# from kivy.app import user_data_dir
# from os.path import dirname, join
# out = join(dirname(user_data_dir), 'DCIM')
# DCIM = join('/sdcard', 'DCIM')
self.file_manager.show(os.getenv('EXTERNAL_STORAGE') if platform == 'android' else os.environ["HOME"])
# self.file_manager.show(os.getenv('EXTERNAL_STORAGE'))
self.manager_open = True self.manager_open = True
self.manager.open() self.manager.open()
def select_path(self, path): def select_path(self, path):
"""This method is used to save the select image""" """This method is used to save the select image"""
from PIL import Image as PilImage 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)) if platform == 'android':
android_path = os.path.join(
os.environ['ANDROID_PRIVATE'] + '/app/')
newImg.save('{1}/images/default_identicon/{0}.png'.format(
state.association, android_path))
else:
if not os.path.exists('./images/default_identicon/'):
os.makedirs('./images/default_identicon/')
newImg.save('./images/default_identicon/{0}.png'.format(state.association))
self.load_selected_Image(state.association) self.load_selected_Image(state.association)
self.exit_manager() self.exit_manager()
toast('Image changed') toast('Image changed')
def exit_manager(self, *args): def exit_manager(self, *args):
"""Called when the user reaches the root of the directory tree.""" """Called when the user reaches the root of the directory tree."""
self.manager.dismiss() self.manager.dismiss()
self.manager_open = False self.manager_open = False
@ -2577,6 +2614,7 @@ class Draft(Screen):
text='Draft', secondary_text=item['text'], text='Draft', secondary_text=item['text'],
theme_text_color='Custom', theme_text_color='Custom',
text_color=NavigateApp().theme_cls.primary_color) text_color=NavigateApp().theme_cls.primary_color)
meny._txt_right_pad=dp(70)
meny.add_widget(AvatarSampleWidget( meny.add_widget(AvatarSampleWidget(
source='./images/avatar.png')) source='./images/avatar.png'))
meny.bind(on_press=partial( meny.bind(on_press=partial(
@ -2779,6 +2817,7 @@ class Allmails(Screen):
subject + ',' + body)[0:50] + '........').replace('\t', '').replace(' ', ''), subject + ',' + body)[0:50] + '........').replace('\t', '').replace(' ', ''),
theme_text_color='Custom', theme_text_color='Custom',
text_color=NavigateApp().theme_cls.primary_color) text_color=NavigateApp().theme_cls.primary_color)
meny._txt_right_pad=dp(70)
meny.add_widget(AvatarSampleWidget( meny.add_widget(AvatarSampleWidget(
source='./images/text_images/{}.png'.format( source='./images/text_images/{}.png'.format(
avatarImageFirstLetter(body.strip())))) avatarImageFirstLetter(body.strip()))))
@ -3016,18 +3055,23 @@ class SenderDetailPopup(Popup):
self.from_addr = from_addr self.from_addr = from_addr
time_obj = datetime.fromtimestamp(int(timeinseconds)) time_obj = datetime.fromtimestamp(int(timeinseconds))
self.time_tag = time_obj.strftime("%d %b %Y, %I:%M %p") 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) device_type = 2 if platform == 'android' else 1.5
pop_height = device_type * (self.ids.sd_label.height + self.ids.sd_btn.children[0].height)
if len(to_addr) > 3: if len(to_addr) > 3:
self.height = 0 self.height = 0
self.height = pop_height self.height = pop_height
self.ids.to_addId.size_hint_y = None self.ids.to_addId.size_hint_y = None
self.ids.to_addId.height = 50 self.ids.to_addId.height = 50
self.ids.to_addtitle.add_widget(ToAddressTitle())
frmaddbox = ToAddrBoxlayout() frmaddbox = ToAddrBoxlayout()
frmaddbox.set_toAddress(to_addr) frmaddbox.set_toAddress(to_addr)
self.ids.to_addId.add_widget(frmaddbox) self.ids.to_addId.add_widget(frmaddbox)
else: else:
self.ids.space_1.height = dp(0)
self.ids.space_2.height = dp(0)
self.ids.myadd_popup_box.spacing = dp(8 if platform == 'android' else 3)
self.height = 0 self.height = 0
self.height = pop_height / 1.5 self.height = pop_height / 1.2
class OneLineListTitle(OneLineListItem): class OneLineListTitle(OneLineListItem):
@ -3079,6 +3123,11 @@ class ToAddrBoxlayout(BoxLayout):
self.to_addr = to_addr self.to_addr = to_addr
class ToAddressTitle(BoxLayout):
"""class for BoxLayout behaviour"""
pass
class RandomBoxlayout(BoxLayout): class RandomBoxlayout(BoxLayout):
"""class for BoxLayout behaviour""" """class for BoxLayout behaviour"""
pass pass

View File

@ -234,7 +234,7 @@ class NewAddressWizardWaitPage(QtGui.QWizardPage):
self.wizard().button(QtGui.QWizard.NextButton).click() self.wizard().button(QtGui.QWizard.NextButton).click()
return return
elif i == 101: elif i == 101:
print "haha" print("haha")
return return
self.progressBar.setValue(i) self.progressBar.setValue(i)
if i == 50: if i == 50:
@ -347,8 +347,8 @@ if __name__ == '__main__':
wizard = Ui_NewAddressWizard(["a", "b", "c", "d"]) wizard = Ui_NewAddressWizard(["a", "b", "c", "d"])
if (wizard.exec_()): if (wizard.exec_()):
print "Email: " + ("yes" if wizard.field("emailAsWell").toBool() else "no") print("Email: " + ("yes" if wizard.field("emailAsWell").toBool() else "no"))
print "BM: " + ("yes" if wizard.field("onlyBM").toBool() else "no") print("BM: " + ("yes" if wizard.field("onlyBM").toBool() else "no"))
else: else:
print "Wizard cancelled" print("Wizard cancelled")
sys.exit() sys.exit()

View File

@ -1,10 +1,10 @@
[app] [app]
# (str) Title of your application # (str) Title of your application
title = bitapp title = py3
# (str) Package name # (str) Package name
package.name = bitapp package.name = py3
# (str) Package domain (needed for android/ios packaging) # (str) Package domain (needed for android/ios packaging)
package.domain = org.test package.domain = org.test
@ -37,12 +37,13 @@ version = 0.1
# (list) Application requirements # (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy # comma separated e.g. requirements = sqlite3,kivy
requirements = requirements =
python3,
openssl, openssl,
sqlite3, sqlite3,
python2,
kivy, kivy,
bitmsghash, bitmsghash,
kivymd, #git+https://github.com/surbhicis/KivyMD-1.git,
git+https://github.com/surbhicis/KivyMD-1#egg=kivymd,
kivy-garden, kivy-garden,
qrcode, qrcode,
Pillow, Pillow,
@ -206,7 +207,7 @@ android.arch = armeabi-v7a
# #
# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github) # (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
#p4a.source_dir = p4a.source_dir = /home/cis/Music/androidp4a/python-for-android
# (str) The directory in which python-for-android should look for your own build recipes (if any) # (str) The directory in which python-for-android should look for your own build recipes (if any)
p4a.local_recipes = /home/cis/navjotrepo/PyBitmessage/src/bitmessagekivy/android/python-for-android/recipes/ p4a.local_recipes = /home/cis/navjotrepo/PyBitmessage/src/bitmessagekivy/android/python-for-android/recipes/

View File

@ -390,7 +390,9 @@ class sqlThread(threading.Thread):
logger.debug( logger.debug(
'In messages.dat database, done adding address field to the pubkeys table' 'In messages.dat database, done adding address field to the pubkeys table'
' and removing the hash field.') ' and removing the hash field.')
self.cur.execute('''update settings set value=10 WHERE key='version';''') query = '''update settings set value=? WHERE key='version';'''
parameters = (10,)
self.cur.execute(query, parameters)
# Add a new table: chat and chatdata for storing chating conversation # Add a new table: chat and chatdata for storing chating conversation
item = '''SELECT value FROM settings WHERE key='version';''' item = '''SELECT value FROM settings WHERE key='version';'''
@ -398,11 +400,10 @@ class sqlThread(threading.Thread):
self.cur.execute(item, parameters) self.cur.execute(item, parameters)
currentVersion = int(self.cur.fetchall()[0][0]) currentVersion = int(self.cur.fetchall()[0][0])
if currentVersion == 10: if currentVersion == 10:
self.cur.execute('''DROP TABLE chat''')
self.cur.execute( self.cur.execute(
'''CREATE TABLE chat''' '''CREATE TABLE chat'''
''' (msgid blob, senderaddress text, receiveraddress text, message text,''' ''' (msgid blob, senderaddress text, receiveraddress text, message text,'''
''' senttime text, receivedtime text, image blob, audio blob, reference blob,''' ''' receivedtime text, image blob, audio blob, reference blob,'''
''' UNIQUE(msgid) ON CONFLICT REPLACE)''') ''' UNIQUE(msgid) ON CONFLICT REPLACE)''')
item = '''update settings set value=? WHERE key='version';''' item = '''update settings set value=? WHERE key='version';'''
parameters = (11,) parameters = (11,)

View File

@ -174,7 +174,7 @@ class namecoinConnection(object):
message = ('failed', tr._translate("MainWindow", 'Couldn\'t understand NMControl.')) message = ('failed', tr._translate("MainWindow", 'Couldn\'t understand NMControl.'))
else: else:
print "Unsupported Namecoin type" print("Unsupported Namecoin type")
sys.exit(1) sys.exit(1)
return message return message

View File

@ -19,19 +19,19 @@ class HttpConnection(AdvancedDispatcher):
self.destination = (host, 80) self.destination = (host, 80)
self.create_socket(socket.AF_INET, socket.SOCK_STREAM) self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
self.connect(self.destination) self.connect(self.destination)
print "connecting in background to %s:%i" % (self.destination[0], self.destination[1]) print("connecting in background to %s:%i" % (self.destination[0], self.destination[1]))
def state_init(self): def state_init(self):
self.append_write_buf( self.append_write_buf(
"GET %s HTTP/1.1\r\nHost: %s\r\nConnection: close\r\n\r\n" % ( "GET %s HTTP/1.1\r\nHost: %s\r\nConnection: close\r\n\r\n" % (
self.path, self.destination[0])) self.path, self.destination[0]))
print "Sending %ib" % (len(self.write_buf)) print("Sending %ib" % (len(self.write_buf)))
self.set_state("http_request_sent", 0) self.set_state("http_request_sent", 0)
return False return False
def state_http_request_sent(self): def state_http_request_sent(self):
if self.read_buf: if self.read_buf:
print "Received %ib" % (len(self.read_buf)) print("Received %ib" % (len(self.read_buf)))
self.read_buf = b"" self.read_buf = b""
if not self.connected: if not self.connected:
self.set_state("close", 0) self.set_state("close", 0)
@ -63,13 +63,13 @@ if __name__ == "__main__":
for host in ("bootstrap8080.bitmessage.org", "bootstrap8444.bitmessage.org"): for host in ("bootstrap8080.bitmessage.org", "bootstrap8444.bitmessage.org"):
proxy = Socks5Resolver(host=host) proxy = Socks5Resolver(host=host)
while asyncore.socket_map: while asyncore.socket_map:
print "loop %s, len %i" % (proxy.state, len(asyncore.socket_map)) print("loop %s, len %i" % (proxy.state, len(asyncore.socket_map)))
asyncore.loop(timeout=1, count=1) asyncore.loop(timeout=1, count=1)
proxy.resolved() proxy.resolved()
proxy = Socks4aResolver(host=host) proxy = Socks4aResolver(host=host)
while asyncore.socket_map: while asyncore.socket_map:
print "loop %s, len %i" % (proxy.state, len(asyncore.socket_map)) print("loop %s, len %i" % (proxy.state, len(asyncore.socket_map)))
asyncore.loop(timeout=1, count=1) asyncore.loop(timeout=1, count=1)
proxy.resolved() proxy.resolved()

View File

@ -49,7 +49,7 @@ if __name__ == "__main__":
if len(asyncore.socket_map) < parallel: if len(asyncore.socket_map) < parallel:
for i in range(parallel - len(asyncore.socket_map)): for i in range(parallel - len(asyncore.socket_map)):
HTTPClient('127.0.0.1', '/') HTTPClient('127.0.0.1', '/')
print "Active connections: %i" % (len(asyncore.socket_map)) print("Active connections: %i" % (len(asyncore.socket_map)))
asyncore.loop(count=len(asyncore.socket_map) / 2) asyncore.loop(count=len(asyncore.socket_map) / 2)
if requestCount % 100 == 0: if requestCount % 100 == 0:
print "Processed %i total messages" % (requestCount) print("Processed %i total messages" % (requestCount))