def update_credentials(self): if self.credentials == None: try: self.logger.debug("credentials get") self.credentials = credentials.load() self.logger.info("credentials retrieved") except credentials.NotFoundException: self.logger.error("credentials not found") raise AbortException("OFF") except GK_IOError, e: try: credentials.trigger_unlock() raise RetryException("keyring is locked, trigger unlock") except GK_CancelledError: self.logger.error("keyring is locked") raise AbortException("KEYR")
import os import subprocess import credentials, request_manager if __name__ == "__main__": # personal Github Account credentials git_username, git_access_token = credentials.load("tokens.txt") switch_account = 0 repo, switch_account = request_manager.request( "https://api.github.com/repos/wala/WALA/commits?per_page=1", git_username, git_access_token, switch_account) repo_last_commit_message = repo[0]["commit"]["message"] if repo == "404: Not Found": print("repo vazio") print()
#!/usr/bin/env python from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait import atexit import tabcomplete import credentials from seleniumprofile import SeleniumProxy proxy = SeleniumProxy(firefox_binary='/opt/firefox/firefox', ca_file='/root/credentials/cert8.db') (u, p) = credentials.load("/root/credentials/mediawiki.txt") wd = proxy.wd atexit.register(wd.quit) wd.implicitly_wait(30) wd.get("http://localhost:8000") wd.find_element_by_link_text("Log in").click() wd.find_element_by_id("wpName1").send_keys(u) wd.find_element_by_id('wpPassword1').send_keys(p) wd.find_element_by_id('wpLoginAttempt').click()
from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.action_chains import ActionChains import atexit import tabcomplete import credentials from seleniumprofile import SeleniumProxy # This script is intended to show Selenium interacting with a # complex web service. It's not recommended to actually use it # except as a teaching example. Use gmail's API for any kind of real # automation. (u, p) = credentials.load('/root/credentials/gmail.txt') wd = webdriver.Firefox(firefox_binary='/opt/firefox/firefox') atexit.register(wd.quit) wd.implicitly_wait(30) wd.get("https://accounts.google.com/ServiceLogin?service=mail&passive=true&" "rm=false&continue=https://mail.google.com/mail/&ss=1&scc=1&" "ltmpl=default<mplcache=2&emr=1&osid=1") login_el = wd.find_element_by_id("identifierId") enter_username = ActionChains(wd) enter_username.move_to_element(login_el)
from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.action_chains import ActionChains import atexit import tabcomplete import credentials from seleniumprofile import SeleniumProxy # This script is intended to show Selenium interacting with a # complex web service. It's not recommended to actually use it # except as a teaching example. Use gmail's API for any kind of real # automation. proxy = SeleniumProxy(firefox_binary='/opt/firefox/firefox', ca_file='/root/credentials/cert8.db') (u, p) = credentials.load('/root/credentials/credentials.txt') wd = proxy.wd atexit.register(wd.quit) wd.implicitly_wait(30) wd.get("https://accounts.google.com/ServiceLogin?service=mail&passive=true&" "rm=false&continue=https://mail.google.com/mail/&ss=1&scc=1&" "ltmpl=default<mplcache=2&emr=1&osid=1") login_el = wd.find_element_by_id("identifierId") enter_username = ActionChains(wd) enter_username.move_to_element(login_el)