Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
strohne committed Jan 18, 2020
1 parent fc89be6 commit 3540b7b
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build/windows/Facepager.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ block_cipher = None

a = Analysis(['Facepager.py'],
pathex=['.'],
binaries=[('../build/windows/PySide2', 'PySide2')],
binaries=[('../build/windows/PySide2', 'PySide2'),('../build/windows/cchardet', 'cchardet')],
datas=[('ssl', 'ssl')],
hiddenimports=[],
hookspath=[],
Expand Down
50 changes: 50 additions & 0 deletions build/windows/cchardet/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
from cchardet import _cchardet
from .version import __version__


def detect(msg):
"""
Args:
msg: str
Returns:
{
"encoding": str,
"confidence": float
}
"""
encoding, confidence = _cchardet.detect_with_confidence(msg)
if isinstance(encoding, bytes):
encoding = encoding.decode()
return {"encoding": encoding, "confidence": confidence}


class UniversalDetector(object):
def __init__(self):
self._detector = _cchardet.UniversalDetector()

def __enter__(self):
return self

def __exit__(self, exception_type, exception_value, traceback):
self.close()
return False

def reset(self):
self._detector.reset()

def feed(self, data):
self._detector.feed(data)

def close(self):
self._detector.close()

@property
def done(self):
return self._detector.done

@property
def result(self):
encoding, confidence = self._detector.result
if isinstance(encoding, bytes):
encoding = encoding.decode()
return {"encoding": encoding, "confidence": confidence}
Binary file not shown.
1 change: 1 addition & 0 deletions build/windows/cchardet/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '2.1.5'
7 changes: 4 additions & 3 deletions src/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Facepager depends on the following packages:
- numpy and pandas: pip install numpy pandas (licensed under BSD and 3-clause BSD license)
- lxml: pip install lxml (BSD licence)
- xmljson pip install xmljson (MIT licence)
- cchardet: pip install cchardet (GPL, LGPL, MPL 1.1)

Facepager needs some secret keys to connect to Facebook, Twitter and YouTube. You can provide the credentials in the user interface or in an credential file. See credentials.py.readme for further details.

Expand All @@ -35,7 +36,7 @@ Open the command line in a directory of your choice and execute the comments ind
$ python -m venv pyenv
$ pyenv\Scripts\activate.bat

$ pip install SQLAlchemy python-dateutil requests_oauthlib requests-toolbelt rauth lxml xmljson numpy pandas
$ pip install SQLAlchemy python-dateutil requests_oauthlib requests-toolbelt rauth lxml xmljson numpy pandas cchardet
$ pip install PySide2==5.11.1

- Start Facepager
Expand All @@ -54,7 +55,7 @@ Open terminal in a directory of your choice and execute the commands indicated b
$ python3 -m venv pyenv
$ source pyenv/bin/activate

$ pip install SQLAlchemy python-dateutil requests_oauthlib requests-toolbelt rauth lxml xmljson numpy pandas
$ pip install SQLAlchemy python-dateutil requests_oauthlib requests-toolbelt rauth lxml xmljson numpy pandas cchardet
$ pip install PySide2==5.11.1

- Start Facepager
Expand All @@ -77,7 +78,7 @@ Open terminal in a directory of your choice and execute the commands indicated b
$ python3 -m venv pyenv
$ source pyenv/bin/activate

$ pip3 install SQLAlchemy python-dateutil requests_oauthlib requests-toolbelt rauth lxml xmljson numpy pandas
$ pip3 install SQLAlchemy python-dateutil requests_oauthlib requests-toolbelt rauth lxml xmljson numpy pandas cchardet
$ pip3 install PySide2==5.11.1

- Start Facepager
Expand Down

0 comments on commit 3540b7b

Please sign in to comment.