Skip to content

Commit

Permalink
Changes from issue #2
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidMetcalfe committed May 20, 2017
1 parent a87dbc6 commit 2e6bc77
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Chrome_Bookmarks_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
userhome = os.path.expanduser('~').replace('\\', '\\\\')
useros = platform.system()
destination = os.path.dirname(os.path.realpath(__file__))
cmd = "python Chrome_Bookmarks_Parser.py"
cmd = ['python', 'Chrome_Bookmarks_Parser.py']


def osWalk():
Expand All @@ -27,7 +27,7 @@ def findChrome():
vernum = platform.version()

# Check if platform is Windows.
if useros is 'Windows':
if useros == 'Windows':
# Determine if OS is XP.
if re.search('^5\.', vernum):
profilePath = os.path.normpath(os.path.join(
Expand All @@ -41,7 +41,7 @@ def findChrome():
try:
copy(osWalk(), destination)
except Exception as e:
print("{}".format(e.message))
print("{}".format(e))
sys.exit("Cannot find Bookmarks.bak file.")

# Else, assume OS is 10 / 8 / 7 / Vista.
Expand All @@ -57,13 +57,13 @@ def findChrome():
try:
copy(osWalk(), destination)
except Exception as e:
print("{}".format(e.message))
print("{}".format(e))
sys.exit("Cannot find Bookmarks.bak file.")

# Check if platform is Mac OS X.
elif useros is 'Darwin':
elif useros == 'Darwin':
profilePath = os.path.normpath(os.path.join(
userhome, '/Library/Application Support/Google/Chrome/Default'))
userhome, 'Library/Application Support/Google/Chrome/Default'))
filePath = os.path.normpath(os.path.join(
profilePath, "Bookmarks.bak"))
if os.path.exists(filePath):
Expand All @@ -72,11 +72,11 @@ def findChrome():
try:
copy(osWalk(), destination)
except Exception as e:
print("{}".format(e.message))
print("{}".format(e))
sys.exit("Cannot find Bookmarks.bak file.")

# Check if platform is Linux.
elif useros is 'Linux':
elif useros == 'Linux':
profilePath = os.path.normpath(os.path.join(
userhome, '/.config/google-chrome/Default'))
filePath = os.path.normpath(os.path.join(
Expand All @@ -87,13 +87,13 @@ def findChrome():
try:
copy(osWalk(), destination)
except Exception as e:
print("{}".format(e.message))
print("{}".format(e))
sys.exit("Cannot find Bookmarks.bak file.")


try:
findChrome()
subprocess.Popen(cmd)
except Exception as e:
print("{}".format(e.message))
print("{}".format(e))
sys.exit("Oops. Something went wrong.")

0 comments on commit 2e6bc77

Please sign in to comment.