output results text details

This commit is contained in:
psy 2013-09-22 07:46:52 -07:00
parent 909c3d0a59
commit 943ce7d01b

17
main.py
View File

@ -24,7 +24,7 @@ from xml_exporter import xml_reporting
import webbrowser import webbrowser
# set to emit debug messages about errors (0 = off). # set to emit debug messages about errors (0 = off).
DEBUG = 1 DEBUG = 0
class bc(object): class bc(object):
""" """
@ -209,14 +209,14 @@ class bc(object):
Set urls to visit Set urls to visit
""" """
if self.browser == "F": if self.browser == "F":
#sqlite operation to get the last visited url from history db. # Sqlite operation to get the last visited url from history db.
conn = sqlite3.connect(self.browser_history_path) conn = sqlite3.connect(self.browser_history_path)
c = conn.cursor() c = conn.cursor()
c.execute('select url, last_visit_date from moz_places ORDER BY last_visit_date DESC') c.execute('select url, last_visit_date from moz_places ORDER BY last_visit_date DESC')
url = c.fetchone() url = c.fetchone()
elif self.browser == "C" or self.browser == "CHROMIUM": #Chrome/Chromium history database elif self.browser == "C" or self.browser == "CHROMIUM": # Chrome/Chromium history database
#Hack that makes a copy of the locked database to access it while Chrome is running. # Hack that makes a copy of the locked database to access it while Chrome is running.
#Removes the copied database afterwards # Removes the copied database afterwards
import filecmp # is this a standard module? import filecmp # is this a standard module?
a = self.browser_history_path + 'Copy' a = self.browser_history_path + 'Copy'
if os.path.exists(a): if os.path.exists(a):
@ -489,8 +489,9 @@ class bc(object):
print "Error: Browser is not responding correctly.\n" print "Error: Browser is not responding correctly.\n"
print '='*45 + "\n" print '='*45 + "\n"
print "Status: Waiting for new urls ...\n" print "Status: Waiting for new urls\n"
print "Type 'Control+C' to exit...\n" print "Type 'Control+C' to exit.\n"
print '='*45 + "\n"
# stay latent waiting for new urls # stay latent waiting for new urls
while True: while True:
url = urlparse(self.getURL()).netloc url = urlparse(self.getURL()).netloc
@ -507,7 +508,7 @@ class bc(object):
os.remove('data.xml') os.remove('data.xml')
open('data.xml', 'w') # starting a new xml data container in write mode open('data.xml', 'w') # starting a new xml data container in write mode
traces = self.try_running(self.traces, "\nInternal error tracerouting.") traces = self.try_running(self.traces, "\nInternal error tracerouting.")
time.sleep(5) # free process time time.sleep(5) # free process time or goodbye :-)
if __name__ == "__main__": if __name__ == "__main__":
app = bc() app = bc()