summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/server/outer_packages.py
AgeCommit message (Collapse)AuthorFilesLines
2016-08-01Python3 support for Stateful daemonYaroslav Brustinov1-1/+2
Python 3.5 support in ZMQ Verify ZMQ health in Stateful daemon Add get_trex_config() command to Stateful daemon Strip debug info on Python ZMQ .so files
2016-03-22stateful server zmq import fix. TODO: check zmq per platform/py_versionYaroslav Brustinov1-1/+1
2015-12-27updated server pacakges include for ZMQimarom1-4/+8
2015-10-14Fixed trex bugs in Ubuntu disctribution (Firing trex-daemon server) and ↵Dan Klein1-2/+1
unresolved domain name handling.
2015-08-26Rearranged files and external libraries in two different locations, one for ↵Dan Klein1-2/+1
cpp (trex-core/external_libs) and one for python (trex-core/scripts/external_libs)
2015-08-24Changes location of console and fixed dependenciesDan Klein1-1/+0
2015-08-24Fixed dependencies of Control Plane to use external_lib sourcesDan Klein1-4/+6
2015-08-24Initial push to external_lib migrationDan Klein1-45/+13
2015-06-24first versionHanoh Haim1-0/+66
__(self, notifyMessage = None): super(ProgressThread, self).__init__() self.stoprequest = threading.Event() self.notifyMessage = notifyMessage def run(self): if self.notifyMessage is not None: print(self.notifyMessage, end=' ') while not self.stoprequest.is_set(): print("\b.", end=' ') sys.stdout.flush() time.sleep(5) def join(self, timeout=None): if self.notifyMessage is not None: print(termstyle.green("Done!\n"), end=' ') self.stoprequest.set() super(ProgressThread, self).join(timeout) class TimedProgressBar(threading.Thread): def __init__(self, time_in_secs): super(TimedProgressBar, self).__init__() self.stoprequest = threading.Event() self.stopFlag = False self.time_in_secs = time_in_secs + 15 # 80 # taking 15 seconds extra widgets = ['Running T-Rex: ', progressbar.Percentage(), ' ', progressbar.Bar(marker='>',left='[',right=']'), ' ', progressbar.ETA()] self.pbar = progressbar.ProgressBar(widgets=widgets, maxval=self.time_in_secs*2) def run (self): # global g_stop print() self.pbar.start() try: for i in range(0, self.time_in_secs*2 + 1): if (self.stopFlag == True): break time.sleep(0.5) self.pbar.update(i) # self.pbar.finish() except KeyboardInterrupt: # self.pbar.finish() print("\nInterrupted by user!!") self.join() finally: print() def join(self, isPlannedStop = True, timeout=None): if isPlannedStop: self.pbar.update(self.time_in_secs*2) self.stopFlag = True else: self.stopFlag = True # Stop the progress bar in its current location self.stoprequest.set() super(TimedProgressBar, self).join(timeout) def timedProgressBar(time_in_secs): widgets = ['Running T-Rex: ', progressbar.Percentage(), ' ', Bar(marker='>',left='[',right=']'), ' ', progressbar.ETA()] pbar = progressbar.ProgressBar(widgets=widgets, maxval=time_in_secs*2) pbar.start() for i in range(0, time_in_secs*2 + 1): time.sleep(0.5) pbar.update(i) pbar.finish() print()