Closed happytommyl closed 2 years ago
Thanks for your contribution!
dev_test branch
, pyinstaller
, it requires a lot of compatibility testing, and need to fix problems with build script)if sys.platform == 'win32': balabala
Advanced Setting
and set them on the web page)Thanks for your contribution!
- The current code conflicts with the
dev_test branch
,- If it is not necessary, do not import third-party libraries. (Because the project is packaged by
pyinstaller
, it requires a lot of compatibility testing, and need to fix problems with build script)- ~Because this problem does not exist on MacOS or Linux, it can be applied only to windows at present. something like:
if sys.platform == 'win32': balabala
~- I'll handle the menu problem~ (At present, I am preparing to transfer the low-frequency menu items to
Advanced Setting
and set them on the web page)
main
branch, I'll check the conflicts with dev_test
later. Or maybe there's a better way to handle that?macast/utils.py
)SETTING_DIR/macast.lock
manually? (Under different operating systems, different startup methods sys.argv[0]
may not be an fixed value)Ask a question: If the application exits unexpectedly and the lock file is not emptied in time, will it fail to start later?
- I made a fork from the
main
branch, I'll check the conflicts withdev_test
later. Or maybe there's a better way to handle that?- It's a one-file solution for now and handles platform dependency. Maybe I'll reimplement the functionality later if you think so fit. (simple Copy-Paste will break license or not?)
- As mentioned above, it has platform handler built in.
- Thanks for that part :)
- Fork dev branch is recommended. (It's my fault. I'll update the documentation later)
- I don't know the difference between different licenses, but code modifications should be allowed to tendo. (You can place SingleInstance in
macast/utils.py
)- Should the location of lockfile be set to
SETTING_DIR/macast.lock
manually? (Under different operating systems, different startup methodssys.argv[0]
may not be an fixed value)Ask a question: If the application exits unexpectedly and the lock file is not emptied in time, will it fail to start later?
os.path.abspath(sys.argv[0])
will be the same to the executable, ie Macast.exe
or Macast.py
. So if a user has two different copies Macast.exe
file in two different locations, it can run simultaneously. If I change it to a fixed value, it won't be able to run. Both methods are OK, depending on the design purpose. .lock
file first, and will raise an exception if the .lock
file is in use. So there won't be a problem with unexpected exits. Current problem:
.lock
file until the next start-up. Maybe create the .lock
file when the user toggles the switch?If I put the settings for singleton mode
into advanced settings
, Macast will restart automatically after the settings are modified, which just avoids this problem.
Current problem:
- If the user started the program with single-mode turned off, then turn on the option, it won't create the
.lock
file until the next start-up. Maybe create the.lock
file when the user toggles the switch?
os.path.abspath(sys.argv[0]) will be the same to the executable, ie Macast.exe or Macast.py. So if a user has two different copies Macast.exe file in two different locations, it can run simultaneously. If I change it to a fixed value, it won't be able to run. Both methods are OK, depending on the design purpose.
I think it would be better to set it to a fixed value, which is also convenient for debugging from the source code.
Ok, I'll make some changes and merge it to dev
branch, I'll close this PR then.
103
I have made a quick and dirty way to check if an instance of the program is already running, by using the singleton module included in tendo. It will create a dummy file in the default local temp folder (platform dependant) and check if the file existed. If the file exists, it will raise an error and quit the program.
TODO:
macast_setting.json
file. I don't quite understand how the context menu works. :(