remove e4u dependency as it supports Python 2 only

This commit is contained in:
Steffen Vogel 2019-04-25 21:23:19 +02:00
parent 71758d2b7c
commit d13c0205c8
6 changed files with 6 additions and 16 deletions

View File

@ -104,14 +104,12 @@ Install required dependencies:
::
$ pip install --pre e4u protobuf python-dateutil yowsup2
$ pip install --pre protobuf python-dateutil yowsup2
- e4u_: is a simple emoji4unicode python bindings
- yowsup_: is a python library that enables you build application
which use WhatsApp service.
.. _Spectrum 2: http://www.spectrum.im
.. _Yowsup 2: https://github.com/tgalal/yowsup
.. _Yowsup 3: https://github.com/tgalal/yowsup
.. _Github: https://github.com/hanzz/libtransport
.. _yowsup: https://github.com/tgalal/yowsup
.. _e4u: https://pypi.python.org/pypi/e4u

View File

@ -39,7 +39,6 @@ setup(name='transwhat',
install_requires=[
'protobuf',
'yowsup',
'e4u',
'Pillow',
'python-dateutil'
],

View File

@ -114,7 +114,7 @@ class BuddyList(dict):
if status is None:
buddy.statusMsg = ""
else:
buddy.statusMsg = utils.softToUni(status)
buddy.statusMsg = status
self.updateSpectrum(buddy)
def load(self, buddies):

View File

@ -141,7 +141,7 @@ class Session(YowsupApp):
if room not in self.groups:
owner = group.getOwner().split('@')[0]
subjectOwner = group.getSubjectOwner().split('@')[0]
subject = utils.softToUni(group.getSubject())
subject = group.getSubject()
self.groups[room] = Group(room, owner, subject, subjectOwner,
self.backend, self.user)
# add/update room participants
@ -276,7 +276,7 @@ class Session(YowsupApp):
def onTextMessage(self, _id, _from, to, notify, timestamp, participant,
offline, retry, body):
buddy = _from.split('@')[0]
messageContent = utils.softToUni(body)
messageContent = body
self.sendReceipt(_id, _from, None, participant)
self.recvMsgIDs.append((_id, _from, participant, timestamp))
self.logger.info("Message received from %s to %s: %s (at ts=%s)" %
@ -436,7 +436,7 @@ class Session(YowsupApp):
room = group.getGroupId()
owner = group.getCreatorJid(full = False)
subjectOwner = group.getSubjectOwnerJid(full = False)
subject = utils.softToUni(group.getSubject())
subject = group.getSubject()
self.groups[room] = Group(room, owner, subject, subjectOwner, self.backend, self.user)
self.groups[room].addParticipants(group.getParticipants(), self.buddies, self.legacyName)

View File

@ -28,7 +28,6 @@ import traceback
import logging
import asyncore
import sys, os
import e4u
import Queue
import transWhat.threadutils
@ -79,8 +78,6 @@ def handleTransportData(data):
logger = logging.getLogger('transwhat')
logger.error(traceback.format_exc())
e4u.load()
closed = False
def connectionClosed():
global closed

View File

@ -21,7 +21,6 @@ __email__ = "post@steffenvogel.de"
along with transWhat. If not, see <http://www.gnu.org/licenses/>.
"""
import e4u
import base64
import hashlib
@ -42,9 +41,6 @@ def ago(secs):
return "%d %s ago" % (diff, period)
def softToUni(message):
return e4u.translate(message.encode("utf-8"), reverse=False, **e4u.SOFTBANK_TRANSLATE_PROFILE)
def decodePassword(password):
return base64.b64decode(bytes(password))