Skip to content

Commit

Permalink
Correct logger output
Browse files Browse the repository at this point in the history
  • Loading branch information
pbhogara committed Apr 17, 2024
1 parent f1fb968 commit 50c6dbe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions generated/nidaqmx/_install_daqmx.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,17 @@ def _get_daqmx_installed_version() -> Optional[str]:
dpkg_output = subprocess.run(
["dpkg", "-l", "ni-daqmx"], stdout=subprocess.PIPE
).stdout.decode("utf-8")
version_match = re.search(r"ii\s+ni-daqmx\s+(\d+\.\d+\.\d+)", dpkg_output)
version_match = re.search(r"ii\s+ni-daqmx\s+(\d+\.\d+\.\d+)", dpkg_output).group(1)
elif distro.id() == "opensuse" or distro.id() == "redhat":
rpm_output = subprocess.run(
["rpm", "-q", "ni-daqmx"], stdout=subprocess.PIPE
).stdout.decode("utf-8")
version_match = re.search(r"ni-daqmx-(\d+\.\d+\.\d+)", rpm_output)
version_match = re.search(r"ni-daqmx-(\d+\.\d+\.\d+)", rpm_output).group(1)
else:
raise click.ClickException(f"Unsupported distribution '{distro.id()}'")
if version_match:
_logger.debug("Found installed NI-DAQmx version: %s", version_match)
return version_match.group(1)
return version_match
else:
_logger.debug("No installed NI-DAQmx version found.")
return None
Expand Down
6 changes: 3 additions & 3 deletions src/handwritten/_install_daqmx.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,17 @@ def _get_daqmx_installed_version() -> Optional[str]:
dpkg_output = subprocess.run(
["dpkg", "-l", "ni-daqmx"], stdout=subprocess.PIPE
).stdout.decode("utf-8")
version_match = re.search(r"ii\s+ni-daqmx\s+(\d+\.\d+\.\d+)", dpkg_output)
version_match = re.search(r"ii\s+ni-daqmx\s+(\d+\.\d+\.\d+)", dpkg_output).group(1)
elif distro.id() == "opensuse" or distro.id() == "redhat":
rpm_output = subprocess.run(
["rpm", "-q", "ni-daqmx"], stdout=subprocess.PIPE
).stdout.decode("utf-8")
version_match = re.search(r"ni-daqmx-(\d+\.\d+\.\d+)", rpm_output)
version_match = re.search(r"ni-daqmx-(\d+\.\d+\.\d+)", rpm_output).group(1)
else:
raise click.ClickException(f"Unsupported distribution '{distro.id()}'")
if version_match:
_logger.debug("Found installed NI-DAQmx version: %s", version_match)
return version_match.group(1)
return version_match
else:
_logger.debug("No installed NI-DAQmx version found.")
return None
Expand Down

0 comments on commit 50c6dbe

Please sign in to comment.