ledoge / novideo_srgb

Calibrate monitors to sRGB or other color spaces on NVIDIA GPUs, based on EDID data or ICC profiles
GNU General Public License v3.0
1.04k stars 40 forks source link

Fixes for Windows Building #67

Closed mkoehmst closed 1 year ago

mkoehmst commented 1 year ago

Made the following fixes in util_os.py, develop branch. Running Python 3.10:

For function def make_win32_compatible_long_path(path, maxpath=259): Changed one line to: and len(str(path)) > maxpath

This is necessary because WindowsPath does not have a len dunder, so convert to string first

Also had to update some of the os module wrapper functions because they don't match Python 3 arg lists: def makedirs(path, mode=0o777, exist_ok=False): return _makedirs(make_win32_compatible_long_path(path, 247), mode=mode, exist_ok=exist_ok)

def stat(path, *, dir_fd=None, follow_symlinks=True): return _stat(make_win32_compatible_long_path(path), dir_fd=dir_fd, follow_symlinks=follow_symlinks)

Lock file flushing doesn't seem to be working on Windows, I commented out this line in main.py under the context manager with lock. Still has an issue trying to clear lock on program close, but at least it opens now!

lock.flush()

Sorry for just dropping this here in the issues, I am not git sophisticated when it comes to doing pull requests. These are very simple changes though so I hope this suffices!

EDIT: Oh yeah, one more thing. Extra modules needed for windows: pywin32, comtypes, wmi

veksha commented 1 year ago

wrong repo?

mkoehmst commented 1 year ago

OMG, yes, my bad. This was meant for displaycal-py3.