mirror of
https://github.com/pdxlocations/contact.git
synced 2026-08-06 08:53:29 +02:00
Refactoring continued
This commit is contained in:
@@ -9,11 +9,11 @@ V 0.2.0
|
||||
import curses
|
||||
from pubsub import pub
|
||||
|
||||
from parsers import setup_parser
|
||||
from interfaces import initialize_interface
|
||||
from rx_handler import on_receive
|
||||
from curses_ui import main_ui
|
||||
from utils import get_channels
|
||||
from utilities.arg_parser import setup_parser
|
||||
from utilities.interfaces import initialize_interface
|
||||
from message_handlers.rx_handler import on_receive
|
||||
from ui.curses_ui import main_ui
|
||||
from utilities.utils import get_channels
|
||||
import globals
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from meshtastic import BROADCAST_NUM
|
||||
from utils import get_node_list, decimal_to_hex, get_nodeNum
|
||||
from utilities.utils import get_node_list, decimal_to_hex, get_nodeNum
|
||||
import globals
|
||||
from curses_ui import update_packetlog_win, draw_node_list, update_messages_window, draw_channel_list, add_notification
|
||||
from ui.curses_ui import update_packetlog_win, draw_node_list, update_messages_window, draw_channel_list, add_notification
|
||||
|
||||
|
||||
def on_receive(packet):
|
||||
@@ -1,9 +1,9 @@
|
||||
import curses
|
||||
import textwrap
|
||||
import globals
|
||||
from utils import get_node_list, get_name_from_number, get_channels
|
||||
from utilities.utils import get_node_list, get_name_from_number, get_channels
|
||||
from settings import settings
|
||||
from tx_handler import send_message
|
||||
from message_handlers.tx_handler import send_message
|
||||
|
||||
def handle_notification(channel_number, add=True):
|
||||
global channel_win
|
||||
@@ -1,12 +1,6 @@
|
||||
|
||||
import globals
|
||||
from meshtastic.protobuf import config_pb2
|
||||
|
||||
def get_nodeNum():
|
||||
myinfo = globals.interface.getMyNodeInfo()
|
||||
myNodeNum = myinfo['num']
|
||||
return myNodeNum
|
||||
|
||||
def get_channels():
|
||||
node = globals.interface.getNode('^local')
|
||||
device_channels = node.channels
|
||||
@@ -35,6 +29,11 @@ def get_node_list():
|
||||
node_list.append(node['num'])
|
||||
return node_list
|
||||
|
||||
def get_nodeNum():
|
||||
myinfo = globals.interface.getMyNodeInfo()
|
||||
myNodeNum = myinfo['num']
|
||||
return myNodeNum
|
||||
|
||||
def decimal_to_hex(decimal_number):
|
||||
return f"!{decimal_number:08x}"
|
||||
|
||||
Reference in New Issue
Block a user