Skip to content

Commit

Permalink
[#367] Updated DisplayCAL.worker.Worker.get_display_name_short() to…
Browse files Browse the repository at this point in the history
… replace the space characters in the returned string with "_" to fix profile installation under Windows.
  • Loading branch information
eoyilmaz committed Oct 9, 2024
1 parent 631e43e commit 99a0004
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions DisplayCAL/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -8869,7 +8869,6 @@ def get_display_name_short(self, prepend_manufacturer=False, prefer_edid=False):

If name can't be shortened (e.g. because it's already 10 characters
or less), return full string

"""
display_name = self.get_display_name(prepend_manufacturer, prefer_edid)
if len(display_name) > 10:
Expand All @@ -8893,14 +8892,15 @@ def get_display_name_short(self, prepend_manufacturer=False, prefer_edid=False):
# Weigh parts further to the right higher
display_name = re.sub(r"^[^([{\w]+", "", part)
maxweight = weight

# Shortname should not contain any spaces.
display_name = re.sub(r"[\s]+", "_", display_name)
return display_name

def get_dispwin_display_profile_argument(self, display_no=0):
"""Return argument corresponding to the display profile for use
with dispwin.

Will either return '-L' (use current profile) or a filename
"""Return argument corresponding to the display profile for use with dispwin.

Will either return '-L' (use current profile) or a filename.
"""
arg = "-L"
try:
Expand Down Expand Up @@ -13393,7 +13393,6 @@ def prepare_dispcal(self, calibrate=True, verify=False, dry_run=False):
All options are read from the user configuration.
You can choose if you want to calibrate and/or verify by passing
the corresponding arguments.

"""
cmd = get_argyll_util("dispcal")
args = ["-v2"]
Expand Down Expand Up @@ -15196,7 +15195,10 @@ def calibrate(self, remove=False):
capture_output = not sys.stdout.isatty()
cmd, args = self.prepare_dispcal()
if not isinstance(cmd, Exception):
print(f"cmd: {cmd}")
print(f"args: {args}")
result = self.exec_cmd(cmd, args, capture_output=capture_output)
print(f"result: {result}")
else:
result = cmd
if not isinstance(result, Exception) and result and getcfg("trc"):
Expand All @@ -15205,10 +15207,13 @@ def calibrate(self, remove=False):
getcfg("profile.name.expanded"),
getcfg("profile.name.expanded"),
)
print(f"dst_pathname: {dst_pathname}")
cal = args[-1] + ".cal"
print(f"cal : {cal}")
result = check_cal_isfile(
cal, lang.getstr("error.calibration.file_not_created")
)
print(f"result : {result}")
if not isinstance(result, Exception) and result:
cal_cgats = add_dispcal_options_to_cal(cal, self.options_dispcal)
if cal_cgats:
Expand Down

0 comments on commit 99a0004

Please sign in to comment.