(self)
| 142 | return self.markdown_processor.modify_wrappers(markdown_content) |
| 143 | |
| 144 | def process_clipboard_image(self): |
| 145 | if not self.process_pre_exist_image: |
| 146 | last_image=self.initial_image |
| 147 | else: |
| 148 | last_image = None |
| 149 | while self.running: |
| 150 | try: |
| 151 | if self.screenshot_hotkey_isNull or self.screenshot_hotkey_triggered: |
| 152 | image = ImageGrab.grabclipboard() |
| 153 | if isinstance(image, Image.Image) and image != last_image: |
| 154 | self.log_callback("检测到新的剪贴板图像。") |
| 155 | self.app.update_icon_status('processing') |
| 156 | |
| 157 | markdown_content = self.process_image(image) |
| 158 | pyperclip.copy(markdown_content) |
| 159 | self.log_callback("识别后的内容已复制到剪贴板。") |
| 160 | |
| 161 | self.app.update_icon_status('success') |
| 162 | last_image = image |
| 163 | self.screenshot_hotkey_triggered = False |
| 164 | except Exception as e: |
| 165 | self.log_callback(f"发生错误: {e}") |
| 166 | self.app.update_icon_status('error') |
| 167 | self.running = False |
| 168 | break |
| 169 | time.sleep(1) |
| 170 | |
| 171 | def start(self): |
| 172 | self.running = True |
nothing calls this directly
no test coverage detected