Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove logging after quit. Fix signal disconnect err #26

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,33 @@ There are some extra steps for installation on Windows:
- Download and install https://visualstudio.microsoft.com/visual-cpp-build-tools/ C++ Build Tools
- Build the win32DeviceEnum pyd by `$ cd win32DeviceEnum && python.exe setup.py build_ext --inplace`

#### MacOS

On Mac, and particularly on Arm64, you will need to install dependencies manually.
This is reflected in the ./github/actions/build.yaml file.

1. [cyndilib](https://github.com/nocarryr/cyndilib)

Get the project from the repo and build it locally
```
$ git clone https://github.com/nocarryr/cyndilib.git
$ cd cyndilib
$ pip install setuptools numpy cython
$ pip install .
```

2. [tesserocr](https://github.com/sirfz/tesserocr)

Get the project from the repo and built it locally.
This assumes you have Homewbrew in `/opt/homebrew` but if it's in `/usr/local` then there's no need for the extra flagging.

```
$ git clone https://github.com/sirfz/tesserocr.git
$ cd tesserocr
$ /opt/homebrew/brew install tesseract leptonica
$ PATH="$PATH:/opt/homebrew/bin" CPPFLAGS="-I/opt/homebrew/include -L/opt/homebrew/lib" python3 -m pip install --no-binary tesserocr tesserocr
```

### Running from source

1. Compile the UI files into Python:
Expand Down
1 change: 0 additions & 1 deletion http_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ def stop_http_server():
conn = http.client.HTTPConnection("localhost", PORT)
conn.request("GET", "/shutdown")
conn.close()
logger.info("Server stopped")
except Exception as e:
pass

Expand Down
7 changes: 6 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
QObject,
QCoreApplication,
QEvent,
QMetaMethod,
)
from dotenv import load_dotenv
from os import path
Expand Down Expand Up @@ -927,7 +928,11 @@ def updateSources(self, camera_sources: list[CameraInfo]):
self.ui.comboBox_camera_source.addItem(source.description, source)

self.ui.comboBox_camera_source.setEnabled(True)
self.ui.comboBox_camera_source.currentIndexChanged.disconnect()
currentIndexChangedSignal = QMetaMethod.fromSignal(
self.ui.comboBox_camera_source.currentIndexChanged
)
if self.ui.comboBox_camera_source.isSignalConnected(currentIndexChangedSignal):
self.ui.comboBox_camera_source.currentIndexChanged.disconnect()
self.ui.comboBox_camera_source.currentIndexChanged.connect(self.sourceChanged)

# enable the source view frame
Expand Down