refactor: shorten some lines.
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user