Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some code of uiautomator was removed after upgraded to 1.0.1 from 0.3.6 #299

Open
Kingdom88a opened this issue Dec 21, 2020 · 0 comments
Open

Comments

@Kingdom88a
Copy link

Dear xiaoCong and all,
Firestly, many thanks for your upgrading to 1.0.1 from 0.3.6, but i have some doubt on code differance, are them writing mistaken? please give us a powerfull confirm on your side. the below code was removed after upgrade:
u2_version_code=3 #was remove
if self.checkVersion(): #added on 0.3.6, removed on 1.0.1

the followed function were removed.

def checkVersion(self):
    ''' check uiautomator apk version '''
    version_code = self.adb.getVersionCode('com.github.uiautomator')
    return True if u2_version_code > version_code else False

@property
def toast(self):
    devive_self = self

    class _Toast(object):
        def on(self):
            return devive_self.server.jsonrpc.toast('on')

        def off(self):
            return devive_self.server.jsonrpc.toast('off')

        def __call__(self, action):
            if action == "on":
                return self.on()
            elif action == "off":
                return self.off()
            else:
                raise AttributeError("Invalid parameter: %s" % action)
    return _Toast()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant