Skip to content

Commit

Permalink
Update 1.4.4
Browse files Browse the repository at this point in the history
- fixed a crash related to cookie retrieval in powershell
- properly named list and keyword search in the main menu
  • Loading branch information
InitialPosition committed Sep 18, 2021
1 parent d384805 commit 203c1fb
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion files/bulk_voting_explanation.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Starting bulk theme voting.
Starting keyword theme voting.

Enter a keyword. The program will then look for themes containing that keyword. You then have the ability to vote YES/NO for all of them at once.
If you only want to vote for certain themes, include their index in the command. For example, 'Y 2 3 12' will vote YES for themes 2, 3 and 12.
Expand Down
2 changes: 1 addition & 1 deletion files/voting_explanation.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Starting list voting.
Starting list theme voting.

The program will show you 10 themes. You have the ability to vote YES/NO for all of them at once.
If you only want to vote for certain themes, include their index in the command. For example, 'Y 2 3 12' will vote YES for themes 2, 3 and 12.
Expand Down
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def main_menu():
valid_selections.append('4')

# print default main menu
print('[1] Start theme voting')
print('[2] Start bulk theme voting')
print('[1] Start list theme voting')
print('[2] Start keyword theme voting')
print('[3] Exit')

if update_check_result == UpdateCheckResult.UPDATE_AVAILABLE:
Expand Down
2 changes: 1 addition & 1 deletion util/CONSTANTS.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
CONFIG_FILE = 'config.yml'
VERSION = '1.4.3'
VERSION = '1.4.4'
AUTHOR = 'InitialPosition / RedCocoa'
16 changes: 10 additions & 6 deletions util/CookieFetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import platform
import sqlite3
import subprocess
from configparser import MissingSectionHeaderError
from getpass import getuser
from os import path, getenv
from os.path import isdir
Expand All @@ -26,7 +27,7 @@ def get_cookie_firefox():
os = platform.system()

if os == 'Windows':
appdata_dir = path.join(getenv('APPDATA'), 'Mozilla/Firefox')
appdata_dir = path.join(getenv('APPDATA'), 'Mozilla/Firefox').rstrip().replace("\\", "/")
elif os == 'Linux':
if in_wsl(): # we are in linux subsystem
print('Detected Windows Subsystem for Linux')
Expand All @@ -36,7 +37,7 @@ def get_cookie_firefox():
hack_path = hack_path.rstrip().replace("\\", "/").replace("C:", "/mnt/c")
appdata_dir = path.join(hack_path, 'Mozilla/Firefox')
else:
appdata_dir = path.join('/home/', getuser(), '.mozilla/firefox')
appdata_dir = path.join('/home/', getuser(), '.mozilla/firefox').rstrip().replace("\\", "/")
else:
print('Could not establish OS! Aborting cookie retrieval...')
return -1
Expand All @@ -45,11 +46,14 @@ def get_cookie_firefox():
print('Firefox was not found on this system')
return -1

config_path = path.join(appdata_dir, 'profiles.ini')
config_path = path.join(appdata_dir, 'profiles.ini').rstrip().replace("\\", "/")

config = configparser.ConfigParser()
config.read(config_path)
database_path = path.join(appdata_dir, config['Profile0']['Path'], 'cookies.sqlite')
try:
config = configparser.ConfigParser()
config.read(config_path)
database_path = path.join(appdata_dir, config['Profile0']['Path'], 'cookies.sqlite')
except MissingSectionHeaderError:
return -1

# connect to cookie database and read cookie
try:
Expand Down

0 comments on commit 203c1fb

Please sign in to comment.