py-machineid
Advanced tools
+12
-10
@@ -25,3 +25,3 @@ """ | ||
| __version__ = '0.6.0' | ||
| __version__ = '0.7.0' | ||
| __author__ = 'Zeke Gabrielse' | ||
@@ -38,5 +38,5 @@ __credits__ = 'https://github.com/denisbrodbeck/machineid' | ||
| try: | ||
| from winregistry import WinRegistry | ||
| import winregistry as winregistry_lib | ||
| except ImportError: | ||
| WinRegistry = None | ||
| winregistry_lib = None | ||
@@ -69,10 +69,12 @@ class MachineIdNotFound(RuntimeError): | ||
| def __reg__(registry: str, key: str) -> str: | ||
| def __reg__(key_name: str, value_name: str) -> str: | ||
| if winregistry_lib is None: | ||
| return None | ||
| try: | ||
| with WinRegistry() as reg: | ||
| return reg.read_entry(registry, key) \ | ||
| .value \ | ||
| .strip() | ||
| with winregistry_lib.open_value(key_name, value_name) as reg: | ||
| if reg.data and isinstance(reg.data, str): | ||
| return reg.data.strip() | ||
| except OSError: | ||
| return None | ||
| pass | ||
| return None | ||
@@ -88,3 +90,3 @@ def id(winregistry: bool = True) -> str: | ||
| elif platform in ('win32', 'cygwin', 'msys'): | ||
| if winregistry and WinRegistry is not None: | ||
| if winregistry: | ||
| id = __reg__(r'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography', 'MachineGuid') | ||
@@ -91,0 +93,0 @@ else: |
+2
-2
| Metadata-Version: 2.1 | ||
| Name: py-machineid | ||
| Version: 0.6.0 | ||
| Version: 0.7.0 | ||
| Summary: Get the unique machine ID of any host (without admin privileges) | ||
@@ -24,3 +24,3 @@ Home-page: https://github.com/keygen-sh/py-machineid | ||
| _An open, source-available software licensing and distribution API._ | ||
| _A fair source software licensing and distribution API._ | ||
@@ -27,0 +27,0 @@ ## Install |
| Metadata-Version: 2.1 | ||
| Name: py-machineid | ||
| Version: 0.6.0 | ||
| Version: 0.7.0 | ||
| Summary: Get the unique machine ID of any host (without admin privileges) | ||
@@ -24,3 +24,3 @@ Home-page: https://github.com/keygen-sh/py-machineid | ||
| _An open, source-available software licensing and distribution API._ | ||
| _A fair source software licensing and distribution API._ | ||
@@ -27,0 +27,0 @@ ## Install |
| [:sys_platform == "win32"] | ||
| winregistry | ||
| winregistry<3.0.0,>=2.0.1 |
+1
-1
@@ -16,3 +16,3 @@ # py-machineid | ||
| _An open, source-available software licensing and distribution API._ | ||
| _A fair source software licensing and distribution API._ | ||
@@ -19,0 +19,0 @@ ## Install |
+1
-1
@@ -17,3 +17,3 @@ from machineid import __version__, __author__ | ||
| license='MIT', | ||
| install_requires=['winregistry; sys_platform == "win32"'], | ||
| install_requires=['winregistry>=2.0.1,<3.0.0; sys_platform == "win32"'], | ||
| packages=['machineid'], | ||
@@ -20,0 +20,0 @@ package_data={ |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
13496
0.38%128
1.59%