Skip to content

Commit

Permalink
Version Bump (#77)
Browse files Browse the repository at this point in the history
- Various Bug Fixes
- Version bump to 2.0.4
  • Loading branch information
mgeitz authored Mar 9, 2022
1 parent 48059e1 commit fb422f1
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 24 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
An Everquest Emulator Log Parser with NCurses Interface for Linux

![img](https://i.imgur.com/wMs0RcV.png)
![img](https://i.imgur.com/NK3bzx2.png)
![img](https://i.imgur.com/NoqTNfT.png)
![img](https://i.imgur.com/a9GNMV3.png)

> Best used with the [Linux EQ Launch Manager](https://gist.github.com/mgeitz/aa295061c51b26d53dd818d0ebb3e37a) to maintain reasonable log file size
Expand All @@ -15,7 +12,7 @@ An Everquest Emulator Log Parser with NCurses Interface for Linux
Install from pypi
```sh
$ # Install Stable
$ pip3 install eqalert==1.9.14
$ pip3 install eqalert==2.0.4
$
$ # Install whatever I just pushed to pypi
$ pip3 install eqalert
Expand Down
7 changes: 5 additions & 2 deletions eqa/eqalert.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def main():
# Thread Events
raid = threading.Event()
cfg_reload = threading.Event()
log_reload = threading.Event()
heal_parse = threading.Event()
spell_parse = threading.Event()
exit_flag = threading.Event()
Expand Down Expand Up @@ -222,7 +223,7 @@ def main():
## Produce log_q
process_log = threading.Thread(
target=eqa_log.process,
args=(exit_flag, char_log, log_q),
args=(log_reload, exit_flag, char_log, log_q),
)
process_log.daemon = True
process_log.start()
Expand Down Expand Up @@ -268,7 +269,9 @@ def main():
# Ensure char/server combo exists as file
if os.path.exists(new_char_log):
# Stop watch on current log
log_reload.set()
process_log.join()
log_reload.clear()
# Set new character
char_name, char_server = new_message.payload.split("_")
state.set_char(char_name)
Expand All @@ -278,7 +281,7 @@ def main():
# Start new log watch
process_log = threading.Thread(
target=eqa_log.process,
args=(exit_flag, char_log, log_q),
args=(log_reload, exit_flag, char_log, log_q),
)
process_log.daemon = True
process_log.start()
Expand Down
33 changes: 20 additions & 13 deletions eqa/lib/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ def process(
)
)
elif line_type == "direction":
direction = re.findall('(?:North(?:East|West)?|South(?:East|West)?|(?:Ea|We)st)', check_line)
direction = re.findall(
"(?:North(?:East|West)?|South(?:East|West)?|(?:Ea|We)st)",
check_line,
)
system_q.put(
eqa_struct.message(
eqa_settings.eqa_time(),
Expand Down Expand Up @@ -117,10 +120,9 @@ def process(
)
)
elif line_type == "you_new_zone":
nz_iter = 0
current_zone = ""
# what the fuck
current_zone = re.findall('(?<=You have entered)[a-zA-Z\s]+', line)
current_zone = re.findall(
"(?<=You have entered)[a-zA-Z\s]+", check_line
)
sound_q.put(eqa_struct.sound("speak", current_zone[0]))
display_q.put(
eqa_struct.display(
Expand All @@ -136,10 +138,12 @@ def process(
current_zone[0],
)
)
if current_zone not in config["zones"].keys():
eqa_config.add_zone(current_zone, base_path)
elif current_zone in config["zones"].keys() and not raid.is_set():
if config["zones"][current_zone] == "raid":
if current_zone[0] not in config["zones"].keys():
eqa_config.add_zone(current_zone[0], base_path)
elif (
current_zone[0] in config["zones"].keys() and not raid.is_set()
):
if config["zones"][current_zone[0]] == "raid":
raid.set()
display_q.put(
eqa_struct.display(
Expand All @@ -150,8 +154,8 @@ def process(
)
)
sound_q.put(eqa_struct.sound("speak", "Raid mode enabled"))
elif current_zone in config["zones"].keys() and raid.is_set():
if config["zones"][current_zone] != "raid":
elif current_zone[0] in config["zones"].keys() and raid.is_set():
if config["zones"][current_zone[0]] != "raid":
raid.clear()
display_q.put(
eqa_struct.display(
Expand All @@ -170,7 +174,10 @@ def process(
for keyphrase, value in config["line"][line_type][
"alert"
].items():
if str(keyphrase).lower() in check_line.lower() and value == "true":
if (
str(keyphrase).lower() in check_line.lower()
and value == "true"
):
sound_q.put(eqa_struct.sound("alert", line_type))
display_q.put(
eqa_struct.display(
Expand All @@ -186,7 +193,7 @@ def process(
and raid.is_set()
):
if keyphrase == "assist" or keyphrase == "rampage":
target = re.findall('^([\w\-]+)', line)
target = re.findall("^([\w\-]+)", check_line)
payload = keyphrase + " on " + target[0]
else:
payload = keyphrase
Expand Down
4 changes: 2 additions & 2 deletions eqa/lib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,10 +730,10 @@ def build_config(base_path):
"4": "watch out.wav",
"5": "hello.wav"
},
"version": "1.10.0"
"version": "2.0.4"
},
"zones": {
"An Arena (pvp) area": "false",
"An Arena (PVP) Area": "false",
"Befallen": "false",
"Blackburrow": "false",
"Butcherblock Mountains": "false",
Expand Down
4 changes: 2 additions & 2 deletions eqa/lib/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import eqa.lib.settings as eqa_settings


def process(exit_flag, char_log, log_q):
def process(log_reload, exit_flag, char_log, log_q):
"""
Process: char_log
Produce: log_q
Expand All @@ -35,7 +35,7 @@ def process(exit_flag, char_log, log_q):
try:
log_file = open(char_log, "r")
log_file.seek(0, 2)
while not exit_flag.is_set():
while not exit_flag.is_set() and not log_reload.is_set():
line = log_file.readline()
if not line:
time.sleep(0.01)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="eqalert",
version="1.10.0",
version="2.0.4",
author="Michael Geitz",
author_email="[email protected]",
install_requires=[
Expand Down

0 comments on commit fb422f1

Please sign in to comment.