refactor: shorten some lines.

This commit is contained in:
UpstreamData
2024-01-16 08:39:15 -07:00
parent 468134e754
commit 34ca5ba68f
4 changed files with 12 additions and 6 deletions

View File

@@ -50,14 +50,16 @@ def api_min_version(version: str):
if not api_major_ver >= allowed_major_ver: if not api_major_ver >= allowed_major_ver:
raise APIError( raise APIError(
f"Miner API version v{api_major_ver}.{api_minor_ver}.{api_patch_ver} is too low for {func.__name__}, required version is at least v{version}" f"Miner API version v{api_major_ver}.{api_minor_ver}.{api_patch_ver}"
f" is too low for {func.__name__}, required version is at least v{version}"
) )
if not ( if not (
api_minor_ver >= allowed_minor_ver api_minor_ver >= allowed_minor_ver
and api_major_ver == allowed_major_ver and api_major_ver == allowed_major_ver
): ):
raise APIError( raise APIError(
f"Miner API version v{api_major_ver}.{api_minor_ver}.{api_patch_ver} is too low for {func.__name__}, required version is at least v{version}" f"Miner API version v{api_major_ver}.{api_minor_ver}.{api_patch_ver}"
f" is too low for {func.__name__}, required version is at least v{version}"
) )
if not ( if not (
api_patch_ver >= allowed_patch_ver api_patch_ver >= allowed_patch_ver
@@ -65,7 +67,8 @@ def api_min_version(version: str):
and api_major_ver == allowed_major_ver and api_major_ver == allowed_major_ver
): ):
raise APIError( raise APIError(
f"Miner API version v{api_major_ver}.{api_minor_ver}.{api_patch_ver} is too low for {func.__name__}, required version is at least v{version}" f"Miner API version v{api_major_ver}.{api_minor_ver}.{api_patch_ver} "
f"is too low for {func.__name__}, required version is at least v{version}"
) )
return await func(*args, **kwargs) return await func(*args, **kwargs)

View File

@@ -663,7 +663,8 @@ class BFGMinerRPCAPI(BaseMinerRPCAPI):
<summary>Expand</summary> <summary>Expand</summary>
Parameters: Parameters:
which: Which device to zero. Setting this to 'all' zeros all devices. Setting this to 'bestshare' zeros only the bestshare values for each pool and global. which: Which device to zero. Setting this to 'all' zeros all devices.
Setting this to 'bestshare' zeros only the bestshare values for each pool and global.
summary: Whether or not to show a full summary. summary: Whether or not to show a full summary.

View File

@@ -561,7 +561,8 @@ class BMMinerRPCAPI(BaseMinerRPCAPI):
<summary>Expand</summary> <summary>Expand</summary>
Parameters: Parameters:
which: Which device to zero. Setting this to 'all' zeros all devices. Setting this to 'bestshare' zeros only the bestshare values for each pool and global. which: Which device to zero. Setting this to 'all' zeros all devices.
Setting this to 'bestshare' zeros only the bestshare values for each pool and global.
summary: Whether or not to show a full summary. summary: Whether or not to show a full summary.

View File

@@ -559,7 +559,8 @@ class CGMinerRPCAPI(BaseMinerRPCAPI):
<summary>Expand</summary> <summary>Expand</summary>
Parameters: Parameters:
which: Which device to zero. Setting this to 'all' zeros all devices. Setting this to 'bestshare' zeros only the bestshare values for each pool and global. which: Which device to zero. Setting this to 'all' zeros all devices.
Setting this to 'bestshare' zeros only the bestshare values for each pool and global.
summary: Whether or not to show a full summary. summary: Whether or not to show a full summary.