equal
deleted
inserted
replaced
111 |
111 |
112 def _set_identity(self) -> None: |
112 def _set_identity(self) -> None: |
113 self.identity = self._get_current_identity() |
113 self.identity = self._get_current_identity() |
114 |
114 |
115 def _get_current_identity(self) -> Optional[typelib.CacheStat]: |
115 def _get_current_identity(self) -> Optional[typelib.CacheStat]: |
|
116 # TODO have a cleaner approach on httpstaticrepo side |
|
117 path = self._opener.join(self._filename) |
|
118 if path.startswith(b'https://') or path.startswith(b'http://'): |
|
119 return util.uncacheable_cachestat() |
116 try: |
120 try: |
117 return util.cachestat(self._opener.join(self._filename)) |
121 return util.cachestat(path) |
118 except FileNotFoundError: |
122 except FileNotFoundError: |
119 return None |
123 return None |
120 |
124 |
121 def may_need_refresh(self) -> bool: |
125 def may_need_refresh(self) -> bool: |
122 if 'identity' not in vars(self): |
126 if 'identity' not in vars(self): |