10
10
# * python2-pythondialog
11
11
# * dialog
12
12
13
- import ConfigParser
14
13
import curses
15
14
import os
16
15
import sys
17
16
import time
18
17
from textwrap import fill
19
18
from threading import Timer
20
19
20
+ import ConfigParser
21
21
from dialog import Dialog
22
+
23
+ import helper_addressbook
22
24
import helper_sent
23
25
import l10n
24
26
import network .stats
25
27
import queues
26
28
import shared
27
29
import shutdown
28
30
import state
29
-
30
31
from addresses import addBMIfNotPresent , decodeAddress
31
32
from bmconfigparser import BMConfigParser
32
33
from helper_sql import sqlExecute , sqlQuery
33
34
from inventory import Inventory
35
+ from storage import filesystem
34
36
35
37
# pylint: disable=global-statement
36
38
@@ -635,15 +637,15 @@ def handlech(c, stdscr):
635
637
else :
636
638
addresses [addrcur ][3 ] = 0 # black
637
639
addresses [addrcur ][1 ] = True
638
- shared .reloadMyAddressHashes () # Reload address hashes
640
+ filesystem .reloadMyAddressHashes () # Reload address hashes
639
641
elif t == "5" : # Disable address
640
642
a = addresses [addrcur ][2 ]
641
643
BMConfigParser ().set (a , "enabled" , "false" ) # Set config
642
644
addresses [addrcur ][3 ] = 8 # Set color to gray
643
645
# Write config
644
646
BMConfigParser ().save ()
645
647
addresses [addrcur ][1 ] = False
646
- shared .reloadMyAddressHashes () # Reload address hashes
648
+ filesystem .reloadMyAddressHashes () # Reload address hashes
647
649
elif t == "6" : # Delete address
648
650
r , t = d .inputbox ("Type in \" I want to delete this address\" " , width = 50 )
649
651
if r == d .DIALOG_OK and t == "I want to delete this address" :
@@ -703,7 +705,7 @@ def handlech(c, stdscr):
703
705
r , t = d .inputbox ("New subscription address" )
704
706
if r == d .DIALOG_OK :
705
707
addr = addBMIfNotPresent (t )
706
- if not shared .isAddressInMySubscriptionsList (addr ):
708
+ if not helper_addressbook .isAddressInMySubscriptionsList (addr ):
707
709
r , t = d .inputbox ("New subscription label" )
708
710
if r == d .DIALOG_OK :
709
711
label = t
@@ -713,29 +715,29 @@ def handlech(c, stdscr):
713
715
subscriptions .reverse ()
714
716
715
717
sqlExecute ("INSERT INTO subscriptions VALUES (?,?,?)" , label , addr , True )
716
- shared .reloadBroadcastSendersForWhichImWatching ()
718
+ helper_addressbook .reloadBroadcastSendersForWhichImWatching ()
717
719
elif t == "2" :
718
720
r , t = d .inputbox ("Type in \" I want to delete this subscription\" " )
719
721
if r == d .DIALOG_OK and t == "I want to delete this subscription" :
720
722
sqlExecute (
721
723
"DELETE FROM subscriptions WHERE label=? AND address=?" ,
722
724
subscriptions [subcur ][0 ],
723
725
subscriptions [subcur ][1 ])
724
- shared .reloadBroadcastSendersForWhichImWatching ()
726
+ helper_addressbook .reloadBroadcastSendersForWhichImWatching ()
725
727
del subscriptions [subcur ]
726
728
elif t == "3" :
727
729
sqlExecute (
728
730
"UPDATE subscriptions SET enabled=1 WHERE label=? AND address=?" ,
729
731
subscriptions [subcur ][0 ],
730
732
subscriptions [subcur ][1 ])
731
- shared .reloadBroadcastSendersForWhichImWatching ()
733
+ helper_addressbook .reloadBroadcastSendersForWhichImWatching ()
732
734
subscriptions [subcur ][2 ] = True
733
735
elif t == "4" :
734
736
sqlExecute (
735
737
"UPDATE subscriptions SET enabled=0 WHERE label=? AND address=?" ,
736
738
subscriptions [subcur ][0 ],
737
739
subscriptions [subcur ][1 ])
738
- shared .reloadBroadcastSendersForWhichImWatching ()
740
+ helper_addressbook .reloadBroadcastSendersForWhichImWatching ()
739
741
subscriptions [subcur ][2 ] = False
740
742
elif menutab == 6 :
741
743
set_background_title (d , "Address Book Dialog Box" )
@@ -764,7 +766,7 @@ def handlech(c, stdscr):
764
766
subscriptions .reverse ()
765
767
766
768
sqlExecute ("INSERT INTO subscriptions VALUES (?,?,?)" , label , addr , True )
767
- shared .reloadBroadcastSendersForWhichImWatching ()
769
+ helper_addressbook .reloadBroadcastSendersForWhichImWatching ()
768
770
elif t == "3" :
769
771
r , t = d .inputbox ("Input new address" )
770
772
if r == d .DIALOG_OK :
0 commit comments