Skip to content

Commit 203c1fb

Browse files
Update 1.4.4
- fixed a crash related to cookie retrieval in powershell - properly named list and keyword search in the main menu
1 parent d384805 commit 203c1fb

5 files changed

Lines changed: 15 additions & 11 deletions

File tree

files/bulk_voting_explanation.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Starting bulk theme voting.
1+
Starting keyword theme voting.
22

33
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.
44
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.

files/voting_explanation.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Starting list voting.
1+
Starting list theme voting.
22

33
The program will show you 10 themes. You have the ability to vote YES/NO for all of them at once.
44
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.

main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ def main_menu():
4747
valid_selections.append('4')
4848

4949
# print default main menu
50-
print('[1] Start theme voting')
51-
print('[2] Start bulk theme voting')
50+
print('[1] Start list theme voting')
51+
print('[2] Start keyword theme voting')
5252
print('[3] Exit')
5353

5454
if update_check_result == UpdateCheckResult.UPDATE_AVAILABLE:

util/CONSTANTS.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
CONFIG_FILE = 'config.yml'
2-
VERSION = '1.4.3'
2+
VERSION = '1.4.4'
33
AUTHOR = 'InitialPosition / RedCocoa'

util/CookieFetch.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import platform
33
import sqlite3
44
import subprocess
5+
from configparser import MissingSectionHeaderError
56
from getpass import getuser
67
from os import path, getenv
78
from os.path import isdir
@@ -26,7 +27,7 @@ def get_cookie_firefox():
2627
os = platform.system()
2728

2829
if os == 'Windows':
29-
appdata_dir = path.join(getenv('APPDATA'), 'Mozilla/Firefox')
30+
appdata_dir = path.join(getenv('APPDATA'), 'Mozilla/Firefox').rstrip().replace("\\", "/")
3031
elif os == 'Linux':
3132
if in_wsl(): # we are in linux subsystem
3233
print('Detected Windows Subsystem for Linux')
@@ -36,7 +37,7 @@ def get_cookie_firefox():
3637
hack_path = hack_path.rstrip().replace("\\", "/").replace("C:", "/mnt/c")
3738
appdata_dir = path.join(hack_path, 'Mozilla/Firefox')
3839
else:
39-
appdata_dir = path.join('/home/', getuser(), '.mozilla/firefox')
40+
appdata_dir = path.join('/home/', getuser(), '.mozilla/firefox').rstrip().replace("\\", "/")
4041
else:
4142
print('Could not establish OS! Aborting cookie retrieval...')
4243
return -1
@@ -45,11 +46,14 @@ def get_cookie_firefox():
4546
print('Firefox was not found on this system')
4647
return -1
4748

48-
config_path = path.join(appdata_dir, 'profiles.ini')
49+
config_path = path.join(appdata_dir, 'profiles.ini').rstrip().replace("\\", "/")
4950

50-
config = configparser.ConfigParser()
51-
config.read(config_path)
52-
database_path = path.join(appdata_dir, config['Profile0']['Path'], 'cookies.sqlite')
51+
try:
52+
config = configparser.ConfigParser()
53+
config.read(config_path)
54+
database_path = path.join(appdata_dir, config['Profile0']['Path'], 'cookies.sqlite')
55+
except MissingSectionHeaderError:
56+
return -1
5357

5458
# connect to cookie database and read cookie
5559
try:

0 commit comments

Comments
 (0)