def __init__(self): """ call in the main program. Used to login, get and send the mission data and files. """ # we will need this for each and every script self.hts = htsmain.hts() # verbose is only displayed with -v flag "python basic6.py -v" # stack() outputs list of tuples and we can find the name of the current running function # as the 4th item in the first tuple self.hts.verbose('\nNow Running: %s\n' % stack()[0][3]) # I really don't remember why we even used HTMLParser in this script # It's later used to unescape the password. Might have had a case of special characters... self.h = HTMLParser.HTMLParser() # if you have your username and password set in the config file, you can call Login self.hts.Login() # fetch the whole mission info self.content = self.hts.getMissionInfo('basic', 6) # here were calling the function defined below self.solveBasic6(self.content)
def __init__(self): """ call in some help from the htsmain. """ self.hts = htsmain.hts() self.hts.Login() self.content = self.hts.getMissionInfo("prog", 1) if not os.path.isfile("wordlist.txt"): self.hts.getFile("prog", 1, "wordlist.zip"), self.hts.unZipWordList() self.solveMission()