Subversion Repositories kim

Compare Revisions

Ignore whitespace Rev 4 → Rev 5

/trunk/kim/kim.py
26,16 → 26,22
dnotes = {}
log = None
utils = None
options = None
 
def __init__(self):
self.log = Logger('KIM').get_logger()
self.utils = Utils()
self.options = self.utils.get_app_options()
self.log.debug("Options: %s", self.options)
self.log.info('Starting %s %s', name, version)
 
def run(self):
ff = self.utils.get_firefox_history()
self.log.debug(ff)
snff = self.utils.get_firefox_history()
snch = self.utils.get_chrome_history()
self.log.debug(snff)
self.log.debug(snch)
 
 
def main():
kim = KIM()
kim.run()
/trunk/kim/utils.py
84,7 → 84,7
placesDB = os.path.join(profile_dir, 'places.sqlite')
self.log.debug("Firefox DB: %s", placesDB)
if os.path.isfile(placesDB):
ff = self.print_firefox_history(placesDB)
ff = self.filter_firefox_history(placesDB)
return ff
else:
self.log.warning ('PlacesDb does not exist: %s' % placesDB)
117,23 → 117,23
 
 
def get_chrome_history(self):
pathName = get_chrome_profile_dir()
if pathName == None:
profile_dir = self.get_chrome_profile_dir()
if profile_dir == None:
self.log.warning ("No Chrome profile path found")
return None
elif os.path.isdir(pathName) == False:
self.log.warning ('Path Does Not Exist: %s' % pathName)
elif os.path.isdir(profile_dir) == False:
self.log.warning ('Path Does Not Exist: %s' % profile_dir)
return None
else:
placesDB = os.path.join(pathName, 'history')
placesDB = os.path.join(profile_dir, 'history')
self.log.debug("Chrome DB: %s", placesDB)
if os.path.isfile(placesDB):
print_chrome_history(placesDB)
self.filter_chrome_history(placesDB)
else:
self.log.warning ('PlacesDb does not exist: %s' % placesDB)
return None
 
def print_firefox_history(self, placesDB):
def filter_firefox_history(self, placesDB):
sndict = {}
self.log.debug('Printing Firefox history')
try:
169,7 → 169,7
self.log.error(error)
return None
 
def print_chrome_history(self, placesDB):
def filter_chrome_history(self, placesDB):
self.log.debug('Printing Chrome history')
shutil.copy(placesDB, "history")
c = sqlite3.connect("history")