MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / CacheUpdateFetchProgress

Class CacheUpdateFetchProgress

src/astroprint/software.py:124–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122 self._completionCb()
123
124 class CacheUpdateFetchProgress(apt.progress.base.AcquireProgress):
125 def __init__(self, progressCb):
126 super(CacheUpdateFetchProgress, self).__init__()
127
128 self._progressCb = progressCb
129 self._logger = logging.getLogger(__name__)
130 self._errors = False
131 self._lastCurrentReported = None
132 self._lastTotalReported = None
133
134 def pulse(self, owner):
135 if self.current_items != self._lastCurrentReported or self.total_items != self._lastTotalReported:
136 self._progressCb("sources_update", float(self.current_items) / float(self.total_items))
137 self._logger.info("Update progress item %d of %d" % (self.current_items, self.total_items))
138 self._lastCurrentReported = self.current_items
139 self._lastTotalReported = self.total_items
140
141 return True
142
143class SoftwareUpdater(threading.Thread):
144 updatePhaseProgressInfo = {

Callers 1

_installPackageMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected