| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -48,8 +48,8 @@ class PushProgress(object): | |||
| 48 | 48 | OP_MASK = COUNTING|COMPRESSING|WRITING | |
| 49 | 49 | ||
| 50 | 50 | __slots__ = ("_cur_line", "_seen_ops") | |
| 51 | - re_op_absolute = re.compile("([\w\s]+):\s+()(\d+)()(, done\.)?\s*") | ||
| 52 | - re_op_relative = re.compile("([\w\s]+):\s+(\d+)% \((\d+)/(\d+)\)(,.* done\.)?$") | ||
| 51 | + re_op_absolute = re.compile("([\w\s]+):\s+()(\d+)()(.*)") | ||
| 52 | + re_op_relative = re.compile("([\w\s]+):\s+(\d+)% \((\d+)/(\d+)\)(.*)") | ||
| 53 | 53 | ||
| 54 | 54 | def __init__(self): | |
| 55 | 55 | self._seen_ops = list() | |
@@ -77,7 +77,7 @@ def _parse_progress_line(self, line): | |||
| 77 | 77 | # END could not get match | |
| 78 | 78 | ||
| 79 | 79 | op_code = 0 | |
| 80 | - op_name, percent, cur_count, max_count, done = match.groups() | ||
| 80 | + op_name, percent, cur_count, max_count, message = match.groups() | ||
| 81 | 81 | # get operation id | |
| 82 | 82 | if op_name == "Counting objects": | |
| 83 | 83 | op_code |= self.COUNTING | |
@@ -94,11 +94,16 @@ def _parse_progress_line(self, line): | |||
| 94 | 94 | op_code |= self.BEGIN | |
| 95 | 95 | # END begin opcode | |
| 96 | 96 | ||
| 97 | - message = '' | ||
| 98 | - if done is not None and 'done.' in done: | ||
| 97 | + if message is None: | ||
| 98 | + message = '' | ||
| 99 | + # END message handling | ||
| 100 | + | ||
| 101 | + message = message.strip() | ||
| 102 | + done_token = ', done.' | ||
| 103 | + if message.endswith(done_token): | ||
| 99 | 104 | op_code |= self.END | |
| 100 | - message = done.replace( ", done.", "")[2:] | ||
| 101 | - # END end flag handling | ||
| 105 | + message = message[:-len(done_token)] | ||
| 106 | + # END end message handling | ||
| 102 | 107 | ||
| 103 | 108 | self.update(op_code, cur_count, max_count, message) | |
| 104 | 109 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments