Compare commits
66 Commits
v0.6
...
cis-muzahi
@ -0,0 +1,3 @@
|
||||
# Pickle files (for testing) should always have UNIX line endings.
|
||||
# Windows issue like here https://stackoverflow.com/questions/556269
|
||||
knownnodes.dat text eol=lf
|
@ -0,0 +1,64 @@
|
||||
FROM ubuntu:bionic AS pybm-travis-bionic
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV TRAVIS_SKIP_APT_UPDATE 1
|
||||
|
||||
RUN apt-get update
|
||||
|
||||
RUN apt-get install -yq --no-install-suggests --no-install-recommends \
|
||||
software-properties-common
|
||||
|
||||
RUN dpkg --add-architecture i386
|
||||
|
||||
RUN add-apt-repository ppa:deadsnakes/ppa
|
||||
|
||||
RUN apt-get -y install sudo
|
||||
|
||||
RUN apt-get install -yq --no-install-suggests --no-install-recommends \
|
||||
# travis xenial bionic
|
||||
python-setuptools libssl-dev libpq-dev python-prctl python-dev \
|
||||
python-dev python-virtualenv python-pip virtualenv \
|
||||
# dpkg
|
||||
python-minimal python-setuptools python-all python openssl libssl-dev \
|
||||
dh-apparmor debhelper dh-python python-msgpack python-qt4 python-stdeb \
|
||||
python-all-dev python-crypto python-psutil \
|
||||
fakeroot python-pytest \
|
||||
# Code quality
|
||||
pylint python-pycodestyle python3-pycodestyle pycodestyle python-flake8 \
|
||||
python3-flake8 flake8 python-pyflakes python3-pyflakes pyflakes pyflakes3 \
|
||||
curl \
|
||||
# Wine
|
||||
python python-pip wget wine-stable winetricks mingw-w64 wine32 wine64 xvfb \
|
||||
# Buildbot
|
||||
python3-dev libffi-dev python3-setuptools \
|
||||
python3-pip \
|
||||
# python 3.7
|
||||
python3.7 python3.7-dev \
|
||||
# .travis.yml
|
||||
build-essential libcap-dev tor \
|
||||
language-pack-en
|
||||
|
||||
# cleanup
|
||||
RUN rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN useradd -m -U builder
|
||||
|
||||
RUN echo 'builder ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
||||
|
||||
# travis2bash
|
||||
RUN wget -O /usr/local/bin/travis2bash.sh https://git.bitmessage.org/Bitmessage/buildbot-scripts/raw/branch/master/travis2bash.sh
|
||||
RUN chmod +x /usr/local/bin/travis2bash.sh
|
||||
|
||||
# copy sources
|
||||
COPY . /home/builder/src
|
||||
RUN chown -R builder.builder /home/builder/src
|
||||
|
||||
USER builder
|
||||
|
||||
ENV LANG en_US.UTF-8
|
||||
ENV LANGUAGE en_US:en
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
|
||||
WORKDIR /home/builder/src
|
||||
|
||||
ENTRYPOINT /usr/local/bin/travis2bash.sh
|
@ -1,3 +1,4 @@
|
||||
coverage
|
||||
python_prctl
|
||||
psutil
|
||||
pycrypto
|
||||
|
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker build -t pybm-travis-bionic -f Dockerfile.travis .
|
||||
docker run pybm-travis-bionic
|
@ -1,45 +0,0 @@
|
||||
from helper_sql import *
|
||||
|
||||
|
||||
def search_sql(xAddress="toaddress", account=None, folder="inbox", where=None, what=None, unreadOnly=False):
|
||||
if what is not None and what != "":
|
||||
what = "%" + what + "%"
|
||||
else:
|
||||
what = None
|
||||
|
||||
if folder == "sent":
|
||||
sqlStatementBase = '''
|
||||
SELECT toaddress, fromaddress, subject, status, ackdata, lastactiontime
|
||||
FROM sent '''
|
||||
else:
|
||||
sqlStatementBase = '''SELECT folder, msgid, toaddress, fromaddress, subject, received, read
|
||||
FROM inbox '''
|
||||
sqlStatementParts = []
|
||||
sqlArguments = []
|
||||
if account is not None:
|
||||
if xAddress == 'both':
|
||||
sqlStatementParts.append("(fromaddress = ? OR toaddress = ?)")
|
||||
sqlArguments.append(account)
|
||||
sqlArguments.append(account)
|
||||
else:
|
||||
sqlStatementParts.append(xAddress + " = ? ")
|
||||
sqlArguments.append(account)
|
||||
if folder is not None:
|
||||
if folder == "new":
|
||||
folder = "inbox"
|
||||
unreadOnly = True
|
||||
sqlStatementParts.append("folder = ? ")
|
||||
sqlArguments.append(folder)
|
||||
else:
|
||||
sqlStatementParts.append("folder != ?")
|
||||
sqlArguments.append("trash")
|
||||
if what is not None:
|
||||
sqlStatementParts.append("%s LIKE ?" % (where))
|
||||
sqlArguments.append(what)
|
||||
if unreadOnly:
|
||||
sqlStatementParts.append("read = 0")
|
||||
if len(sqlStatementParts) > 0:
|
||||
sqlStatementBase += "WHERE " + " AND ".join(sqlStatementParts)
|
||||
if folder == "sent":
|
||||
sqlStatementBase += " ORDER BY lastactiontime"
|
||||
return sqlQuery(sqlStatementBase, sqlArguments)
|
@ -1,354 +0,0 @@
|
||||
#:import la kivy.adapters.listadapter
|
||||
#:import factory kivy.factory
|
||||
#:import mpybit bitmessagekivy.mpybit
|
||||
#:import C kivy.utils.get_color_from_hex
|
||||
|
||||
<Navigator>:
|
||||
id: nav_drawer
|
||||
NavigationDrawerIconButton:
|
||||
Spinner:
|
||||
pos_hint:{"x":0,"y":.3}
|
||||
id: btn
|
||||
background_color: app.theme_cls.primary_dark
|
||||
text: app.showmeaddresses(name='text')
|
||||
values: app.showmeaddresses(name='values')
|
||||
on_text:app.getCurrentAccountData(self.text)
|
||||
|
||||
NavigationDrawerIconButton:
|
||||
icon: 'email-open'
|
||||
text: "inbox"
|
||||
on_release: app.root.ids.scr_mngr.current = 'inbox'
|
||||
NavigationDrawerIconButton:
|
||||
icon: 'mail-send'
|
||||
text: "sent"
|
||||
on_release: app.root.ids.scr_mngr.current = 'sent'
|
||||
NavigationDrawerIconButton:
|
||||
icon: 'dropbox'
|
||||
text: "trash"
|
||||
on_release: app.root.ids.scr_mngr.current = 'trash'
|
||||
NavigationDrawerIconButton:
|
||||
icon: 'email'
|
||||
text: "drafts"
|
||||
on_release: app.root.ids.scr_mngr.current = 'dialog'
|
||||
NavigationDrawerIconButton:
|
||||
icon: 'markunread-mailbox'
|
||||
text: "test"
|
||||
on_release: app.root.ids.scr_mngr.current = 'test'
|
||||
NavigationDrawerIconButton:
|
||||
text: "new identity"
|
||||
icon:'accounts-add'
|
||||
on_release: app.root.ids.scr_mngr.current = 'newidentity'
|
||||
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
Toolbar:
|
||||
id: toolbar
|
||||
title: app.getCurrentAccount()
|
||||
background_color: app.theme_cls.primary_dark
|
||||
left_action_items: [['menu', lambda x: app.nav_drawer.toggle()]]
|
||||
Button:
|
||||
text:"EXIT"
|
||||
color: 0,0,0,1
|
||||
background_color: (0,0,0,0)
|
||||
size_hint_y: 0.4
|
||||
size_hint_x: 0.1
|
||||
pos_hint: {'x': 0.8, 'y':0.4}
|
||||
on_press: app.say_exit()
|
||||
|
||||
|
||||
ScreenManager:
|
||||
id: scr_mngr
|
||||
Inbox:
|
||||
id:sc1
|
||||
Sent:
|
||||
id:sc2
|
||||
Trash:
|
||||
id:sc3
|
||||
Dialog:
|
||||
id:sc4
|
||||
Test:
|
||||
id:sc5
|
||||
Create:
|
||||
id:sc6
|
||||
NewIdentity:
|
||||
id:sc7
|
||||
Page:
|
||||
id:sc8
|
||||
AddressSuccessful:
|
||||
id:sc9
|
||||
|
||||
Button:
|
||||
id:create
|
||||
height:100
|
||||
size_hint_y: 0.13
|
||||
size_hint_x: 0.1
|
||||
pos_hint: {'x': 0.85, 'y': 0.5}
|
||||
background_color: (0,0,0,0)
|
||||
on_press: scr_mngr.current = 'create'
|
||||
Image:
|
||||
source: 'images/plus.png'
|
||||
y: self.parent.y - 7.5
|
||||
x: self.parent.x + self.parent.width - 50
|
||||
size: 70, 70
|
||||
|
||||
<SwipeButton@Carousel>:
|
||||
text: ''
|
||||
size_hint_y: None
|
||||
height: 48
|
||||
ignore_perpendicular_swipes: True
|
||||
data_index: 0
|
||||
min_move: 20 / self.width
|
||||
|
||||
on__offset: app.update_index(root.data_index, self.index)
|
||||
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: C('FFFFFF33')
|
||||
|
||||
Rectangle:
|
||||
pos: self.pos
|
||||
size: self.size
|
||||
|
||||
Line:
|
||||
rectangle: self.pos + self.size
|
||||
|
||||
Button:
|
||||
text: 'delete ({}:{})'.format(root.text, root.data_index)
|
||||
on_press: app.delete(root.data_index)
|
||||
|
||||
Button:
|
||||
text: root.text
|
||||
on_press: app.getInboxMessageDetail(self.text)
|
||||
|
||||
Button:
|
||||
text: 'archive'
|
||||
on_press: app.archive(root.data_index)
|
||||
|
||||
<Inbox>:
|
||||
name: 'inbox'
|
||||
RecycleView:
|
||||
data: root.data
|
||||
viewclass: 'SwipeButton'
|
||||
do_scroll_x: False
|
||||
scroll_timeout: 100
|
||||
|
||||
RecycleBoxLayout:
|
||||
id:rc
|
||||
orientation: 'vertical'
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
default_size_hint: 1, None
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: 0,0,0, 1
|
||||
Rectangle:
|
||||
pos: self.pos
|
||||
size: self.size
|
||||
|
||||
<Sent>:
|
||||
name: 'sent'
|
||||
RecycleView:
|
||||
data: root.data
|
||||
viewclass: 'SwipeButton'
|
||||
do_scroll_x: False
|
||||
scroll_timeout: 100
|
||||
|
||||
RecycleBoxLayout:
|
||||
id:rc
|
||||
orientation: 'vertical'
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
default_size_hint: 1, None
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: 0,0,0, 1
|
||||
Rectangle:
|
||||
pos: self.pos
|
||||
size: self.size
|
||||
|
||||
<Trash>:
|
||||
name: 'trash'
|
||||
RecycleView:
|
||||
data: root.data
|
||||
viewclass: 'SwipeButton'
|
||||
do_scroll_x: False
|
||||
scroll_timeout: 100
|
||||
|
||||
RecycleBoxLayout:
|
||||
id:rc
|
||||
orientation: 'vertical'
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
default_size_hint: 1, None
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: 0,0,0, 1
|
||||
Rectangle:
|
||||
pos: self.pos
|
||||
size: self.size
|
||||
|
||||
<Dialog>:
|
||||
name: 'dialog'
|
||||
Label:
|
||||
text:"I have a good dialox box"
|
||||
color: 0,0,0,1
|
||||
<Test>:
|
||||
name: 'test'
|
||||
Label:
|
||||
text:"I am in test"
|
||||
color: 0,0,0,1
|
||||
|
||||
<Create>:
|
||||
name: 'create'
|
||||
GridLayout:
|
||||
rows: 5
|
||||
cols: 1
|
||||
padding: 60,60,60,60
|
||||
spacing: 50
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
height: '32dp'
|
||||
Label:
|
||||
text: 'FROM'
|
||||
color: 0,0,0,1
|
||||
Spinner:
|
||||
size_hint: 1,1
|
||||
pos_hint: {"x":0,"top":1.}
|
||||
pos: 10,10
|
||||
id: spinner_id
|
||||
text: app.showmeaddresses(name='text')
|
||||
values: app.showmeaddresses(name='values')
|
||||
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
height: '32dp'
|
||||
Label:
|
||||
text: 'TO'
|
||||
color: 0,0,0,1
|
||||
TextInput:
|
||||
id: recipent
|
||||
hint_text: 'To'
|
||||
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
height: '32dp'
|
||||
Label:
|
||||
text: 'SUBJECT'
|
||||
color: 0,0,0,1
|
||||
TextInput:
|
||||
id: subject
|
||||
hint_text: 'SUBJECT'
|
||||
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
height: '32dp'
|
||||
Label:
|
||||
text: 'BODY'
|
||||
color: 0,0,0,1
|
||||
TextInput:
|
||||
id: message
|
||||
multiline:True
|
||||
size_hint: 1,2
|
||||
|
||||
Button:
|
||||
text: 'send'
|
||||
size_hint_y: 0.1
|
||||
size_hint_x: 0.2
|
||||
height: '32dp'
|
||||
pos_hint: {'x': .5, 'y': 0.1}
|
||||
on_press: root.send()
|
||||
Button:
|
||||
text: 'cancel'
|
||||
size_hint_y: 0.1
|
||||
size_hint_x: 0.2
|
||||
height: '32dp'
|
||||
pos_hint: {'x': .72, 'y': 0.1}
|
||||
on_press: root.cancel()
|
||||
|
||||
<NewIdentity>:
|
||||
name: 'newidentity'
|
||||
GridLayout:
|
||||
padding: '120dp'
|
||||
cols: 1
|
||||
Label:
|
||||
text:"""Here you may generate as many addresses as you like. Indeed, creating and abandoning addresses is encouraged."""
|
||||
line_height:1.5
|
||||
text_size:(700,None)
|
||||
color: 0,0,0,1
|
||||
BoxLayout:
|
||||
CheckBox:
|
||||
canvas.before:
|
||||
Color:
|
||||
rgb: 1,0,0
|
||||
Ellipse:
|
||||
pos:self.center_x-8, self.center_y-8
|
||||
size:[16,16]
|
||||
group: "money"
|
||||
id:chk
|
||||
text:"use a random number generator to make an address"
|
||||
on_active:
|
||||
root.checked = self.text
|
||||
active:root.is_active
|
||||
|
||||
Label:
|
||||
text: "use a random number generator to make an address"
|
||||
color: 0,0,0,1
|
||||
BoxLayout:
|
||||
CheckBox:
|
||||
canvas.before:
|
||||
Color:
|
||||
rgb: 1,0,0
|
||||
Ellipse:
|
||||
pos:self.center_x-8, self.center_y-8
|
||||
size:[16,16]
|
||||
group: "money"
|
||||
id:chk
|
||||
text:"use a pseudo number generator to make an address"
|
||||
on_active:
|
||||
root.checked = self.text
|
||||
active:not root.is_active
|
||||
Label:
|
||||
text: "use a pseudo number generator to make an address"
|
||||
color: 0,0,0,1
|
||||
Label:
|
||||
color: 0,0,0,1
|
||||
size_hint_x: .35
|
||||
markup: True
|
||||
text: "[b]{}[/b]".format("Randomly generated addresses")
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
height: '32dp'
|
||||
Label:
|
||||
text: "Label (not shown to anyone except you)"
|
||||
color: 0,0,0,1
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
height: '32dp'
|
||||
TextInput:
|
||||
id: label
|
||||
|
||||
Button:
|
||||
text: 'Cancel'
|
||||
size_hint_y: 0.1
|
||||
size_hint_x: 0.3
|
||||
height: '32dp'
|
||||
pos_hint: {'x': .1, 'y': 0.1}
|
||||
Button:
|
||||
text: 'Ok'
|
||||
size_hint_y: 0.1
|
||||
size_hint_x: 0.3
|
||||
height: '32dp'
|
||||
pos_hint: {'x': .5, 'y': 0.1}
|
||||
on_press: root.generateaddress()
|
||||
|
||||
<Page>:
|
||||
name: 'page'
|
||||
Label:
|
||||
text: 'I am on description of my email yooooo'
|
||||
color: 0,0,0,1
|
||||
|
||||
<AddressSuccessful>:
|
||||
name: 'add_sucess'
|
||||
Label:
|
||||
text: 'Successfully created a new bit address'
|
||||
color: 0,0,0,1
|
@ -1,393 +0,0 @@
|
||||
import kivy_helper_search
|
||||
import os
|
||||
import queues
|
||||
import shutdown
|
||||
import state
|
||||
import time
|
||||
|
||||
from kivy.app import App
|
||||
from kivy.lang import Builder
|
||||
from kivy.properties import BooleanProperty
|
||||
from kivy.clock import Clock
|
||||
from navigationdrawer import NavigationDrawer
|
||||
from kivy.properties import ObjectProperty, StringProperty, ListProperty
|
||||
from kivy.uix.screenmanager import Screen
|
||||
from kivy.uix.textinput import TextInput
|
||||
from kivymd.theming import ThemeManager
|
||||
from kivymd.toolbar import Toolbar
|
||||
from bmconfigparser import BMConfigParser
|
||||
from helper_ackPayload import genAckPayload
|
||||
from addresses import decodeAddress, addBMIfNotPresent
|
||||
from helper_sql import sqlExecute
|
||||
|
||||
statusIconColor = 'red'
|
||||
|
||||
|
||||
class NavigateApp(App, TextInput):
|
||||
"""Application uses kivy in which base Class of Navigate App inherits from the App class."""
|
||||
|
||||
theme_cls = ThemeManager()
|
||||
nav_drawer = ObjectProperty()
|
||||
|
||||
def build(self):
|
||||
"""Return a main_widget as a root widget.
|
||||
|
||||
An application can be built if you return a widget on build(), or if you set
|
||||
self.root.
|
||||
"""
|
||||
main_widget = Builder.load_file(
|
||||
os.path.join(os.path.dirname(__file__), 'main.kv'))
|
||||
self.nav_drawer = Navigator()
|
||||
return main_widget
|
||||
|
||||
def getCurrentAccountData(self, text):
|
||||
"""Get Current Address Account Data."""
|
||||
state.association = text
|
||||
self.root.ids.sc1.clear_widgets()
|
||||
self.root.ids.sc2.clear_widgets()
|
||||
self.root.ids.sc3.clear_widgets()
|
||||
self.root.ids.sc1.add_widget(Inbox())
|
||||
self.root.ids.sc2.add_widget(Sent())
|
||||
self.root.ids.sc3.add_widget(Trash())
|
||||
self.root.ids.toolbar.title = BMConfigParser().get(
|
||||
state.association, 'label') + '({})'.format(state.association)
|
||||
Inbox()
|
||||
Sent()
|
||||
Trash()
|
||||
|
||||
def say_exit(self):
|
||||
"""Exit the application as uses shutdown PyBitmessage."""
|
||||
print("**************************EXITING FROM APPLICATION*****************************")
|
||||
App.get_running_app().stop()
|
||||
shutdown.doCleanShutdown()
|
||||
|
||||
@staticmethod
|
||||
def showmeaddresses(name="text"):
|
||||
"""Show the addresses in spinner to make as dropdown."""
|
||||
if name == "text":
|
||||
return BMConfigParser().addresses()[0]
|
||||
elif name == "values":
|
||||
return BMConfigParser().addresses()
|
||||
|
||||
def update_index(self, data_index, index):
|
||||
"""Update index after archieve message to trash."""
|
||||
if self.root.ids.scr_mngr.current == 'inbox':
|
||||
self.root.ids.sc1.data[data_index]['index'] = index
|
||||
elif self.root.ids.scr_mngr.current == 'sent':
|
||||
self.root.ids.sc2.data[data_index]['index'] = index
|
||||
elif self.root.ids.scr_mngr.current == 'trash':
|
||||
self.root.ids.sc3.data[data_index]['index'] = index
|
||||
|
||||
def delete(self, data_index):
|
||||
"""It will make delete using remove function."""
|
||||
print("delete {}".format(data_index))
|
||||
self._remove(data_index)
|
||||
|
||||
def archive(self, data_index):
|
||||
"""It will make archieve using remove function."""
|
||||
print("archive {}".format(data_index))
|
||||
self._remove(data_index)
|
||||
|
||||
def _remove(self, data_index):
|
||||
"""It will remove message by resetting the values in recycleview data."""
|
||||
if self.root.ids.scr_mngr.current == 'inbox':
|
||||
self.root.ids.sc1.data.pop(data_index)
|
||||
self.root.ids.sc1.data = [{
|
||||
'data_index': i,
|
||||
'index': d['index'],
|
||||
'height': d['height'],
|
||||
'text': d['text']}
|
||||
for i, d in enumerate(self.root.ids.sc1.data)
|
||||
]
|
||||
elif self.root.ids.scr_mngr.current == 'sent':
|
||||
self.root.ids.sc2.data.pop(data_index)
|
||||
self.root.ids.sc2.data = [{
|
||||
'data_index': i,
|
||||
'index': d['index'],
|
||||
'height': d['height'],
|
||||
'text': d['text']}
|
||||
for i, d in enumerate(self.root.ids.sc2.data)
|
||||
]
|
||||
elif self.root.ids.scr_mngr.current == 'trash':
|
||||
self.root.ids.sc3.data.pop(data_index)
|
||||
self.root.ids.sc3.data = [{
|
||||
'data_index': i,
|
||||
'index': d['index'],
|
||||
'height': d['height'],
|
||||
'text': d['text']}
|
||||
for i, d in enumerate(self.root.ids.sc3.data)
|
||||
]
|
||||
|
||||
def getInboxMessageDetail(self, instance):
|
||||
"""It will get message detail after make selected message description."""
|
||||
try:
|
||||
self.root.ids.scr_mngr.current = 'page'
|
||||
except AttributeError:
|
||||
self.parent.manager.current = 'page'
|
||||
print('Message Clicked {}'.format(instance))
|
||||
|
||||
@staticmethod
|
||||
def getCurrentAccount():
|
||||
"""It uses to get current account label."""
|
||||
return BMConfigParser().get(state.association, 'label') + '({})'.format(state.association)
|
||||
|
||||
|
||||
class Navigator(NavigationDrawer):
|
||||
"""Navigator class uses NavigationDrawer.
|
||||
|
||||
It is an UI panel that shows our app's main navigation menu
|
||||
It is hidden when not in use, but appears when the user swipes
|
||||
a finger from the left edge of the screen or, when at the top
|
||||
level of the app, the user touches the drawer icon in the app bar
|
||||
"""
|
||||
|
||||
image_source = StringProperty('images/qidenticon_two.png')
|
||||
title = StringProperty('Navigation')
|
||||
|
||||
|
||||
class Inbox(Screen):
|
||||
"""Inbox Screen uses screen to show widgets of screens."""
|
||||
|
||||
data = ListProperty()
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Inbox, self).__init__(*args, **kwargs)
|
||||
if state.association == '':
|
||||
state.association = Navigator().ids.btn.text
|
||||
Clock.schedule_once(self.init_ui, 0)
|
||||
|
||||
def init_ui(self, dt=0):
|
||||
"""Clock Schdule for method inbox accounts."""
|
||||
self.inboxaccounts()
|
||||
print(dt)
|
||||
|
||||
def inboxaccounts(self):
|
||||
"""Load inbox accounts."""
|
||||
account = state.association
|
||||
self.loadMessagelist(account, 'All', '')
|
||||
|
||||
def loadMessagelist(self, account, where="", what=""):
|
||||
"""Load Inbox list for inbox messages."""
|
||||
xAddress = "toaddress"
|
||||
queryreturn = kivy_helper_search.search_sql(
|
||||
xAddress, account, 'inbox', where, what, False)
|
||||
if queryreturn:
|
||||
self.data = [{
|
||||
'data_index': i,
|
||||
'index': 1,
|
||||
'height': 48,
|
||||
'text': row[4]}
|
||||
for i, row in enumerate(queryreturn)
|
||||
]
|
||||
else:
|
||||
self.data = [{
|
||||
'data_index': 1,
|
||||
'index': 1,
|
||||
'height': 48,
|
||||
'text': "yet no message for this account!!!!!!!!!!!!!"}
|
||||
]
|
||||
|
||||
|
||||
class Page(Screen):
|
||||
pass
|
||||
|
||||
|
||||
class AddressSuccessful(Screen):
|
||||
pass
|
||||
|
||||
|
||||
class Sent(Screen):
|
||||
"""Sent Screen uses screen to show widgets of screens."""
|
||||
|
||||
data = ListProperty()
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Sent, self).__init__(*args, **kwargs)
|
||||
if state.association == '':
|
||||
state.association = Navigator().ids.btn.text
|
||||
Clock.schedule_once(self.init_ui, 0)
|
||||
|
||||
def init_ui(self, dt=0):
|
||||
"""Clock Schdule for method sent accounts."""
|
||||
self.sentaccounts()
|
||||
print(dt)
|
||||
|
||||
def sentaccounts(self):
|
||||
"""Load sent accounts."""
|
||||
account = state.association
|
||||
self.loadSent(account, 'All', '')
|
||||
|
||||
def loadSent(self, account, where="", what=""):
|
||||
"""Load Sent list for Sent messages."""
|
||||
xAddress = 'fromaddress'
|
||||
queryreturn = kivy_helper_search.search_sql(
|
||||
xAddress, account, "sent", where, what, False)
|
||||
if queryreturn:
|
||||
self.data = [{
|
||||
'data_index': i,
|
||||
'index': 1,
|
||||
'height': 48,
|
||||
'text': row[2]}
|
||||
for i, row in enumerate(queryreturn)
|
||||
]
|
||||
else:
|
||||
self.data = [{
|
||||
'data_index': 1,
|
||||
'index': 1,
|
||||
'height': 48,
|
||||
'text': "yet no message for this account!!!!!!!!!!!!!"}
|
||||
]
|
||||
|
||||
|
||||
class Trash(Screen):
|
||||
"""Trash Screen uses screen to show widgets of screens."""
|
||||
|
||||
data = ListProperty()
|
||||
|
||||
def __init__(self, |