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

[RFE] Python3 support #6

Open
ckujau opened this issue May 30, 2020 · 1 comment
Open

[RFE] Python3 support #6

ckujau opened this issue May 30, 2020 · 1 comment

Comments

@ckujau
Copy link

ckujau commented May 30, 2020

OK, this is not really a bug (yet), more like an enhancement request: with Python2 now in EOL status, afraid-autologin needs to be ported to Python3. By someone. Better yet, someone who can write Python3 :-)

Right now we have:

$ python3 -V
Python 3.6.9

$ python3 autologin.py
  File "autologin.py", line 95
    print input.get_attribute('value')
              ^
SyntaxError: invalid syntax
@ckujau
Copy link
Author

ckujau commented May 30, 2020

Hmpf, should have tried this before opening this issue. So, no big rewrite appears to be needed, only a few tweak during installation and a small modification to autologin.py:

$ cd afraid-autologin
$ virtualenv --python=python3 venv

$ source venv/bin/activate
$ pip3 install -r requirements.txt
$ python3 autologin.py

Unfortunately autologin.py would produce an error when executed this way:

  File "autologin.py", line 95
    print input.get_attribute('value')
              ^
SyntaxError: invalid syntax

Instead of porting this statement to Python3, we can also disable it - it doesn't seem to affect the autlogin:

--- autologin.py.orig   2018-10-12 22:21:23.000000000 -0700
+++ autologin.py        2020-05-29 18:15:00.000000000 -0700
@@ -92,10 +92,10 @@
     logger.debug(buttons)
     for input in buttons:                                                             
     #print attribute name of each input element 
-       print input.get_attribute('value')
+    #  print input.get_attribute('value')
        if input.get_attribute('value') == "Extend your account" :
-           input.click()
-           break
+            input.click()
+            break
     browser.get(URL_DORMANT_EXTEND);
  
     time.sleep(random.randint(1,3))

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