Skip to content

Commit

Permalink
Fixed Plater updater
Browse files Browse the repository at this point in the history
  • Loading branch information
AcidWeb committed Mar 13, 2024
1 parent 01195b2 commit 73ad59b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions CB/Wago.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,18 @@ def __init__(self, accountname):

def parse_storage_internal(self, data):
for script in data:
if data[script]['url']:
search = self.urlParser.search(data[script]['url'])
if (search is not None and search.group(1) and search.group(2) and
'ignoreWagoUpdate' not in data[script]):
if 'skipWagoUpdate' in data[script]:
self.ignored[search.group(1)] = int(data[script]['skipWagoUpdate'])
if script['url']:
search = self.urlParser.search(script['url'])
if search is not None and search.group(1) and search.group(2) and 'ignoreWagoUpdate' not in script:
if 'skipWagoUpdate' in script:
self.ignored[search.group(1)] = int(script['skipWagoUpdate'])
self.list[search.group(1)] = int(search.group(2))

def parse_storage(self):
with open(Path(f'WTF/Account/{self.accountName}/SavedVariables/Plater.lua'), 'r', encoding='utf-8',
errors='ignore') as file:
data = file.read().replace('PlaterDB = {', '{', 1).rsplit('PlaterLanguage = {', 1)[0]
platerdata = loads(data)
data = file.read()
platerdata = loads(re.search(r'PlaterDB = {\n.*?}\n', data, re.DOTALL).group().replace('PlaterDB = {', '{', 1))
for profile in platerdata['profiles']:
if data := platerdata['profiles'][profile]['script_data']:
self.parse_storage_internal(data)
Expand Down
2 changes: 1 addition & 1 deletion CB/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import requests
from rich.terminal_theme import TerminalTheme

__version__ = '4.5.3'
__version__ = '4.5.4'
__license__ = 'GPLv3'
__copyright__ = '2019-2024, Paweł Jastrzębski <pawelj@iosphe.re>'
__docformat__ = 'restructuredtext en'
Expand Down

0 comments on commit 73ad59b

Please sign in to comment.