Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, iterations, track_time=True,
stream=2, title='', monitor=False, update_interval=None):
Prog.__init__(self, iterations, track_time, stream,
title, monitor, update_interval)
self.last_progress = 0
self._print()
if monitor:
try:
self.process.cpu_percent()
self.process.memory_percent()
except AttributeError: # old version of psutil
self.process.get_cpu_percent()
self.process.get_memory_percent()
def __init__(self, iterations, track_time=True, width=30, bar_char='#',
stream=2, title='', monitor=False, update_interval=None):
Prog.__init__(self, iterations, track_time,
stream, title, monitor, update_interval)
self.bar_width = width
self._adjust_width()
self.bar_char = bar_char
self.last_progress = 0
if monitor:
try:
self.process.cpu_percent()
self.process.memory_percent()
except AttributeError: # old version of psutil
self.process.get_cpu_percent()
self.process.get_memory_percent()
if self.item_id:
self._cache_item_id()