Skip to content

Commit

Permalink
Upgrade version 3.0.1 - 2022/03/24
Browse files Browse the repository at this point in the history
  • Loading branch information
mxnt10 committed Mar 25, 2022
1 parent 5313666 commit fb4b162
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 25 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file.
Todas as mudanças notáveis neste projeto serão documentadas neste arquivo.


## [ 3.0.1 ] - 2022-03-24 ###########################################

### Changed / Modificado
- Changed error control.
###

#####################################################################


## [ 3.0 ] - 2022-03-19 #############################################

### Fixed / Corrigido
Expand Down
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,33 @@
<h3 align="center">
Unofficial webapp for WhatsApp Web using python and PyQt5 with PyQtWebEngine.
</h3>
<h1 align="center">
<h3 align="center">
<a><img src="https://raw.githubusercontent.com/mxnt10/whats/master/common/preview.png"></a>
</h1>
</h3><br/>
</body>
</html>

### Required packages
## Required packages

- python >= 3.6
- libnotify (notify-send) >= 0.7.9

### Required python modules
### Python modules:

- beautifulsoup4 >= 4.10.0
- PyQt5 >= 5.15.2
- PyQtWebEngine >= 5.15.2
- requests >= 2.25.1
- soupsieve >= 2.3.1

### Installation instructions
## Shotcuts

- Ctrl+R: Reload webapp page.
- Ctrl+Q: Quit application.
- Alt+S: Open settings.
- Backspace: Back webapp page.

## Installation instructions

To install "Whats", use the following commands:
```sh
Expand All @@ -35,7 +42,7 @@ $ cd whats
$ sudo ./install.sh
```

### GNU General Public License
## GNU General Public License

This repository has scripts that were created to be free software.<br/>
Therefore, they can be distributed and/or modified within the terms of the *GNU General Public License*.
Expand All @@ -44,12 +51,12 @@ Therefore, they can be distributed and/or modified within the terms of the *GNU
>
>Free Software Foundation (FSF) Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
### Comments
## Comments

In case of bugs, problems of execution or construction of packages, constructive criticism, among others,
please submit a message to one of the contacts below.

### Contact
## Contact

Maintainer: Mauricio Ferrari<br/>
E-Mail: *m10ferrari1200@gmail.com*<br/>
Expand Down
2 changes: 1 addition & 1 deletion RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0
3.0.1
Binary file modified common/preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion src/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
from os import chmod, makedirs
from shutil import rmtree

# Módulos do PyQt5
from PyQt5.QtCore import qDebug

# Modulos integrados (src)
from version import __appname__

Expand All @@ -27,4 +30,4 @@ def prevent():
makedirs(log_folder)
chmod(log_folder, 0o444) # Impedir alteração
except Exception as msg:
print(msg)
qDebug('\033[31m[DEBUG]\033[33m: ' + str(msg) + '...\033[m')
6 changes: 4 additions & 2 deletions src/jsonTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

# Módulos importados
from json import dump, load
from logging import warning
from os import makedirs, remove
from os.path import expanduser, isdir

# Módulos do PyQt5
from PyQt5.QtCore import qDebug

# Modulos integrados (src)
from version import __appname__

Expand Down Expand Up @@ -40,7 +42,7 @@ def checkSettings():
with open(j_file):
pass
except Exception as msg:
warning("\033[33m %s. \033[32mCreate a settings.json ...\033[m", msg)
qDebug('\033[31m[DEBUG]\033[33m: ' + str(msg) + '. \033[32mCreate a settings.json...\033[m')
if not isdir(j_folder):
makedirs(j_folder)
with open(j_file, 'w') as jfile:
Expand Down
23 changes: 11 additions & 12 deletions src/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-

# Módulos importados
from logging import warning, error
from os import remove, walk
from os.path import expanduser, isfile, realpath, isdir
from subprocess import run
Expand All @@ -10,7 +9,7 @@
from shutil import copy

# Módulos do Qt5
from PyQt5.QtCore import QUrl
from PyQt5.QtCore import QUrl, qDebug
from PyQt5.QtMultimedia import QMediaContent

# Modulos integrados (src)
Expand All @@ -36,13 +35,13 @@ def setIcon(entry_icon=None):
with open(icon):
return icon
except Exception as msg:
warning('\033[33m %s.\033[32m Use a local icon...\033[m', msg)
qDebug('\033[31m[DEBUG]\033[33m: ' + str(msg) + '. \033[32mUse a local icon...\033[m')
try:
with open(l_icon):
return l_icon
except Exception as msg:
except Exception as err:
# Caso nenhum ícone seja encontrado, vai sem ícone mesmo
error('\033[31m %s \033[m', msg)
qDebug('\033[31m[DEBUG]:' + str(err) + '.\033[m')
return None


Expand All @@ -60,8 +59,8 @@ def setDesktop():
remove(desk)
return True

except Exception as msg: # Se o arquivo não existe, não tem porque ativar a opção autostart
error('\033[31m %s \033[m', msg)
except Exception as err: # Se o arquivo não existe, não tem porque ativar a opção autostart
qDebug('\033[31m[DEBUG]:' + str(err) + '.\033[m')
write_json('AutoStart', False)
return False

Expand All @@ -76,12 +75,12 @@ def setSound(sound):
with open(dirSound + ext):
return dirSound + ext # Esse aqui não precisa realpath, pois é caminho absoluto
except Exception as msg:
warning('\033[33m %s.\033[32m Use a local sound folder...\033[m', msg)
qDebug('\033[31m[DEBUG]\033[33m: ' + str(msg) + '. \033[32mUse a local sound folder...\033[m')
try:
with open(l_dirSound + ext):
return l_dirSound + ext
except Exception as msg:
warning('\033[33m %s.\033[32m Use a other option...\033[m', msg)
qDebug('\033[31m[DEBUG]\033[33m: ' + str(msg) + '. \033[32mUse a other option...\033[m')


# Cria uma lista com as opções de temas de som.
Expand All @@ -103,7 +102,7 @@ def setTranslate():
if not isdir(dirTranslate):
dirTranslate = __dir__ + '/translate'
else:
warning('\033[32m Using a local translate folder...\033[m')
qDebug('\033[31m[DEBUG]\033[32m: Using a local translate folder...\033[m')
return dirTranslate


Expand All @@ -118,7 +117,7 @@ def checkUpdate(self, num):
if res.status_code != 200:
raise ValueError('Connection fail, ' + str(res.status_code))

new_ver = res.text.split("\n")
new_ver = res.text.split('\n')
if new_ver[0] != str(__version__):
com = 'notify-send --app-name="' + __appname__ + ' - ' + self.textUpdate1 + '" --expire-time=' +\
str(set_json('TimeMessage')) + ' "' + self.textUpdate2 + '.\n' + self.textUpdate3 +\
Expand All @@ -128,4 +127,4 @@ def checkUpdate(self, num):
self.notify_sound.play()

except ValueError as msg:
error("\033[33m Update check failed.\033[31m %s \033[m", msg)
qDebug('\033[31m[DEBUG]\033[33m: Update check failed. \033[31m' + str(msg) + '.\033[m')
2 changes: 1 addition & 1 deletion src/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

__pagename__ = __appname__ + ' - WhatsApp Desktop'

__version__ = '3.0'
__version__ = '3.0.1'

__url__ = 'https://web.whatsapp.com/'

Expand Down

0 comments on commit fb4b162

Please sign in to comment.