Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to disable graphs #2

Open
ShadyMedic opened this issue Jan 18, 2021 · 4 comments
Open

Ability to disable graphs #2

ShadyMedic opened this issue Jan 18, 2021 · 4 comments

Comments

@ShadyMedic
Copy link

The statistical graphs that the application generates are cool and everything, but many people, including me, just want to export compile the .txt files into a better-looking .html format.

Would it be possible to add an argument that would disable the creation and display of them?

The command line input could then look like this:
python main.py chat.txt --no-graph

@ace-racer
Copy link
Owner

Added a flag in the command line to disable showing the graphs. By default, the graphs will not be shown now, although they will be generated and saved in outputs folder. Please clone the latest from master and try again. Please let me know if any further comments, else will close this issue.

@ShadyMedic
Copy link
Author

Thanks for responding so fast.
Undortunatelly, when I type just the basic command without any arguments (python main.py chat.txt), I get this error:

Traceback (most recent call last):
  File "C:\Users\MyName\Downloads\WhatsAppStuff\WhatsAppMessagesInsights-master\main.py", line 20, in <module>
    os.environ["show_graphs"] = show_graphs
  File "C:\Python39\lib\os.py", line 684, in __setitem__
    value = self.encodevalue(value)
  File "C:\Python39\lib\os.py", line 742, in check_str
    raise TypeError("str expected, not %s" % type(value).__name__)
TypeError: str expected, not NoneType

The file chat.txt is present in the Inputs folder and it is the same file I tried in the previous version.

@ace-racer
Copy link
Owner

Sorry for that, I have fixed this issue now. Please pull the latest from master and try again.

@ShadyMedic
Copy link
Author

It works now! Thank you.

But I've discovered a few different issues in the process.
This one message produces these three lines of output.

01.01.21 18:40 - MyName: MyMessage
<empty line>
Problematic message - The rest of the message

image

I guess that the issue is caused by:

  1. Every line of export is treated as a new message
  2. Everything before the first dash is treated as time

If I may suggest, I think that the most reliable way to detect a new message is a regex looking like this: /^DATE FORMAT\s-\s/. Of course, this would require a way to detect the date format to fill the regex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants