Skip to content

Commit

Permalink
Add message methods to BaseWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
UmSenhorQualquer committed Mar 25, 2019
1 parent fe065d1 commit 9f922cf
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pyforms_terminal/basewidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,20 @@ def __savePID(self, pid):
raise e



def message(self, msg, title=None, msg_type=None):
print('*****', title.upper(), '*****')
print(msg)

def success(self, msg, title=None): self.message(msg, title, msg_type='success')
def info(self, msg, title=None): self.message(msg, title, msg_type='info')
def warning(self, msg, title=None): self.message(msg, title, msg_type='warning');
def alert(self, msg, title=None): self.message(msg, title, msg_type='error')
def critical(self, msg, title=None): self.message(msg, title, msg_type='error')
def about(self, msg, title=None): self.message(msg, title, msg_type='about')
def aboutQt(self, msg, title=None): self.message(msg, title, msg_type='aboutQt')


def executeCommand(self, cmd, cwd=None, env=None):
if cwd!=None:
currentdirectory = os.getcwd()
Expand Down

0 comments on commit 9f922cf

Please sign in to comment.