mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 14:27:00 +08:00
Add: Brute-force adb connect to NoxPlayer, LDPlayer, MEmuPlayer and adb replacement
This commit is contained in:
18
module/deploy/utils.py
Normal file
18
module/deploy/utils.py
Normal file
@@ -0,0 +1,18 @@
|
||||
class cached_property:
|
||||
"""
|
||||
cached-property from https://github.com/pydanny/cached-property
|
||||
|
||||
A property that is only computed once per instance and then replaces itself
|
||||
with an ordinary attribute. Deleting the attribute resets the property.
|
||||
Source: https://github.com/bottlepy/bottle/commit/fa7733e075da0d790d809aa3d2f53071897e6f76
|
||||
"""
|
||||
|
||||
def __init__(self, func):
|
||||
self.func = func
|
||||
|
||||
def __get__(self, obj, cls):
|
||||
if obj is None:
|
||||
return self
|
||||
|
||||
value = obj.__dict__[self.func.__name__] = self.func(obj)
|
||||
return value
|
||||
Reference in New Issue
Block a user