Browse Source

solved indentation erros

pull/3/head
rscmbbng 11 years ago
parent
commit
cba0658121
  1. 39
      main.py

39
main.py

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/local/bin/python
# -*- coding: iso-8859-15 -*- # -*- coding: iso-8859-15 -*-
""" """
BC (Border-Check) is a tool to retrieve info of traceroute tests over website navigation routes. BC (Border-Check) is a tool to retrieve info of traceroute tests over website navigation routes.
@ -26,12 +26,12 @@ DEBUG = 1
class bc(object): class bc(object):
""" """
BC main Class BC main Class
""" """
def __init__(self): def __init__(self):
""" """
Init defaults Init defaults
""" """
self.browser = "" # "F" Firefox / "C" Chrome self.browser = "" # "F" Firefox / "C" Chrome
self.browser_path = "" self.browser_path = ""
self.url = "" self.url = ""
@ -39,14 +39,14 @@ class bc(object):
def set_options(self, options): def set_options(self, options):
""" """
Set program options Set program options
""" """
self.options = options self.options = options
def create_options(self, args=None): def create_options(self, args=None):
""" """
Create options for OptionParser Create options for OptionParser
""" """
self.optionParser = BCOptions() self.optionParser = BCOptions()
self.options = self.optionParser.get_options(args) self.options = self.optionParser.get_options(args)
if not self.options: if not self.options:
@ -55,8 +55,8 @@ class bc(object):
def try_running(self, func, error, args=None): def try_running(self, func, error, args=None):
""" """
Try running a function and print some error if it fails and exists with a fatal error. Try running a function and print some error if it fails and exists with a fatal error.
""" """
options = self.options options = self.options
args = args or [] args = args or []
try: try:
@ -72,8 +72,8 @@ class bc(object):
def check_browser(self): def check_browser(self):
""" """
Check for browser used by system Check for browser used by system
""" """
if sys.platform == 'darwin': if sys.platform == 'darwin':
f_osx = os.path.join(os.path.expanduser('~'), 'Library/Application Support/Firefox/Profiles') f_osx = os.path.join(os.path.expanduser('~'), 'Library/Application Support/Firefox/Profiles')
c_osx = os.path.join(os.path.expanduser('~'), 'Library/Application Support/Google/Chrome/Default/History') c_osx = os.path.join(os.path.expanduser('~'), 'Library/Application Support/Google/Chrome/Default/History')
@ -140,8 +140,8 @@ class bc(object):
def getURL(self): def getURL(self):
""" """
Set urls to visit Set urls to visit
""" """
print "Browser database:", self.browser_path, "\n" print "Browser database:", self.browser_path, "\n"
conn = sqlite3.connect(self.browser_path) conn = sqlite3.connect(self.browser_path)
c = conn.cursor() c = conn.cursor()
@ -164,8 +164,8 @@ class bc(object):
def getGEO(self): def getGEO(self):
""" """
Get Geolocation database (http://dev.maxmind.com/geoip/legacy/geolite/) Get Geolocation database (http://dev.maxmind.com/geoip/legacy/geolite/)
""" """
# Download and extract database # Download and extract database
try: try:
urllib.urlretrieve('http://xsser.sf.net/map/GeoLiteCity.dat.gz', urllib.urlretrieve('http://xsser.sf.net/map/GeoLiteCity.dat.gz',
@ -183,8 +183,8 @@ class bc(object):
def run(self, opts=None): def run(self, opts=None):
""" """
Run BorderCheck Run BorderCheck
""" """
#eprint = sys.stderr.write #eprint = sys.stderr.write
# set options # set options
if opts: if opts:
@ -250,4 +250,3 @@ if __name__ == "__main__":
if options: if options:
app.set_options(options) app.set_options(options)
app.run() app.run()

Loading…
Cancel
Save