updates alert function for cli
- alert correctly collects title from server - alert now posts any new incomming messages to the commandline in form of a dict
This commit is contained in:
		@@ -249,9 +249,9 @@ class Bump:
 | 
			
		||||
        while True:
 | 
			
		||||
            time.sleep(sleep_time)
 | 
			
		||||
            messages = self.list()
 | 
			
		||||
            for message in messages:
 | 
			
		||||
            for message in messages['messages']:
 | 
			
		||||
                if self._to_log_line(message) not in log and message != {}:
 | 
			
		||||
                    print(message['data'])
 | 
			
		||||
                    print({'title': message['title'], 'data': message['data']})
 | 
			
		||||
                    self._save_log(message)
 | 
			
		||||
                    log = self.load_log()
 | 
			
		||||
                    log = self._load_log()
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -6,8 +6,8 @@ import typer
 | 
			
		||||
def default(
 | 
			
		||||
        message_arg:Optional[str] = typer.Argument(None, help="The message to be bumped"),
 | 
			
		||||
        message:Optional[str] = typer.Option(None, help="The message to be bumped"),
 | 
			
		||||
        reset:bool = typer.Option(False, help="remove all senders"),
 | 
			
		||||
        alert:Optional[str] = typer.Option(None, help="check continuously for new messages"),
 | 
			
		||||
        reset:Optional[bool] = typer.Option(False, help="remove all senders"),
 | 
			
		||||
        alert:Optional[bool] = typer.Option(False, help="check continuously for new messages"),
 | 
			
		||||
        secret:Optional[str] = typer.Option(None, help="change the sender and e2e keys")):
 | 
			
		||||
    bp = bump.Bump()
 | 
			
		||||
    if message_arg is not None:
 | 
			
		||||
@@ -19,7 +19,7 @@ def default(
 | 
			
		||||
    elif reset:
 | 
			
		||||
        delete_senders()
 | 
			
		||||
    elif alert is not None:
 | 
			
		||||
        alert()
 | 
			
		||||
        alert_process()
 | 
			
		||||
    else:
 | 
			
		||||
        info()
 | 
			
		||||
 | 
			
		||||
@@ -27,7 +27,7 @@ def delete_senders():
 | 
			
		||||
    bp = bump.Bump()
 | 
			
		||||
    bp.delete_senders()
 | 
			
		||||
 | 
			
		||||
def alert():
 | 
			
		||||
def alert_process():
 | 
			
		||||
    bp = bump.Bump()
 | 
			
		||||
    bp.alert()
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user