Skip to content

Commit

Permalink
All working well, super pull request! (mukulhase#880)
Browse files Browse the repository at this point in the history
* resolução do bug send image

* refactor(Requirements): Removed pipenv, added utilities scripts, moved requirements to directory and added commitzen

* test(__init__): Testing functions

Check if all are working

* fix(Docker,-SendImage-on-wapi.js,-added-samples): Fixed docker and remote.py, SendImage funcition also

* style(Black): Added black style

* missing install -r

* feat(get_status()): Add known status when whatsapp web is opened in another browser

from PR: https://github.com/mukulhase/WebWhatsapp-Wrapper/pull/873/commits

* fix(Send-Seen-Error): Send Seen

from PR: https://github.com/mukulhase/WebWhatsapp-Wrapper/pull/838/commits

* docs(How-to-contribute-guide): Added a guide
  • Loading branch information
marcelomaia authored May 21, 2020
1 parent 8798eaf commit 7abcdce
Show file tree
Hide file tree
Showing 41 changed files with 996 additions and 1,027 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ docs/_build
.coverage
.eggs
*.sublime-*
.vscode
geckodriver.log
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ language: python
python:
- "3.7"
install:
- pip install pipenv
- pipenv install --dev
- pip install -r requirements/development.txt
script:
- flake8
- flake8 .
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Use an official Python runtime as a parent image
FROM python:2.7
FROM python:3.8

# Set the working directory to /app
WORKDIR /app

# COPY requirements to /app dir
COPY requirements.txt /app

# Install any needed packages specified in requirements.txt
# Install any needed packages specified in base.txt
RUN pip install --no-cache-dir --trusted-host pypi.python.org -r requirements.txt
29 changes: 0 additions & 29 deletions Pipfile

This file was deleted.

377 changes: 0 additions & 377 deletions Pipfile.lock

This file was deleted.

9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
[![PyPI version](https://badge.fury.io/py/webwhatsapi.svg)](https://badge.fury.io/py/webwhatsapi)
[![Firefox version](https://img.shields.io/badge/Firefox-58.0.2-green.svg)]()
[![All Contributors](https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

## What is it?
This package is used to provide a python interface for interacting with WhatsAPP Web to send and receive Whatsapp messages.
It is based on the official Whatsapp Web Browser Application and uses Selenium browser automation to communicate with Whatsapp Web.

## How to contribute?
[If you are new, click here](docs/contribution_guide.md)

## Local installation

##### Dependencies
Expand All @@ -17,15 +21,12 @@ You will need to install [Gecko Driver](https://github.com/mozilla/geckodriver)
#### From Source
- Clone the repository
- Use `pip install -r requirements.txt` to install the required packages
- or `pipenv install && pipenv install --dev`

#### From PyPI
- Install from pip
`pip install webwhatsapi`

#### From pipenv
- Install from pipenv
`pipenv install`

## Docker and remote Selenium Installation

It may be favorable to run Selenium and the webwhatsapi client as Docker containers. This almost completely avoids any installation problems and any messy local installation or dependency hell. The result is a more stable runtime environment for the client, which could run on a headless server.
Expand Down
8 changes: 0 additions & 8 deletions README.rst

This file was deleted.

4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3"

services:
firefox:
image: selenium/standalone-firefox-debug:3.14.0-dubnium
image: selenium/standalone-firefox-debug:3.14.0-curium
ports:
- "4444:4444"
- "5900:5900"
Expand All @@ -16,7 +16,7 @@ services:
- SELENIUM=http://firefox:4444/wd/hub
volumes:
- ".:/app"
command: /app/docker-entrypoint.sh
command: python sample/remote.py
networks:
- selenium
depends_on:
Expand Down
76 changes: 41 additions & 35 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,20 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('..'))

sys.path.insert(0, os.path.abspath(".."))


# -- Project information -----------------------------------------------------

project = u'WebWhatsAPI'
copyright = u'2018, Mukul Hase, Adarsh Sanjeev'
author = u'Mukul Hase, Adarsh Sanjeev'
project = u"WebWhatsAPI"
copyright = u"2018, Mukul Hase, Adarsh Sanjeev"
author = u"Mukul Hase, Adarsh Sanjeev"

# The short X.Y version
version = u''
version = u""
# The full version, including alpha/beta/rc tags
release = u'2.0.1'
release = u"2.0.1"


# -- General configuration ---------------------------------------------------
Expand All @@ -39,27 +40,27 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.coverage",
"sphinx.ext.ifconfig",
"sphinx.ext.viewcode",
"sphinx.ext.githubpages",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -71,18 +72,18 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path .
exclude_patterns = [u'_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = [u"_build", "Thumbs.db", ".DS_Store"]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme = "alabaster"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -93,7 +94,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -109,7 +110,7 @@
# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'WebWhatsAPIdoc'
htmlhelp_basename = "WebWhatsAPIdoc"


# -- Options for LaTeX output ------------------------------------------------
Expand All @@ -118,15 +119,12 @@
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -136,19 +134,21 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'WebWhatsAPI.tex', u'WebWhatsAPI Documentation',
u'Mukul Hase, Adarsh Sanjeev', 'manual'),
(
master_doc,
"WebWhatsAPI.tex",
u"WebWhatsAPI Documentation",
u"Mukul Hase, Adarsh Sanjeev",
"manual",
),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'webwhatsapi', u'WebWhatsAPI Documentation',
[author], 1)
]
man_pages = [(master_doc, "webwhatsapi", u"WebWhatsAPI Documentation", [author], 1)]


# -- Options for Texinfo output ----------------------------------------------
Expand All @@ -157,9 +157,15 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'WebWhatsAPI', u'WebWhatsAPI Documentation',
author, 'WebWhatsAPI', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"WebWhatsAPI",
u"WebWhatsAPI Documentation",
author,
"WebWhatsAPI",
"One line description of project.",
"Miscellaneous",
),
]


Expand All @@ -168,7 +174,7 @@
# -- Options for intersphinx extension ---------------------------------------

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {"https://docs.python.org/": None}

# -- Options for todo extension ----------------------------------------------

Expand Down
28 changes: 28 additions & 0 deletions docs/contribution_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## Welcome!
First of all, thanks for your contribution. This guide works well on linux with docker installed, if you use in another
way, feel free to contribute.

### System requirements
* Python 3.5+
* pip
* [Docker](https://docs.docker.com/get-docker/)
* Docker compose: `$ sudo pip install docker-compose`
* Some vnc client: in this guide we use [Remmina](https://remmina.org/)

### Prepare environment
* run `docker-compose up firefox`, then a instance of selenium in your
[localhost:4444](http://localhost:4444/wd/hub/static/resource/hub.html) will be available
* open your vnc client in localhost:5900, it will ask for a password that is `secret`

### Run project
* create some virtual env
* install dependencies: `$ pip install -r requirements/development.txt`
* create selenium variable: `$ export SELENIUM=http://localhost:4444/wd/hub`
* create a number variable: `$ export MY_PHONE=55...`
* run `$ ipython` and load a example `%load sample/message_with_thumb.py`
* check your vnc client
* run another example `%load sample/remote.py`

### Commit standardization
Please, use our tool `utils/commit.sh` to make commits more standardized
* To apply [black](https://github.com/psf/black) style: `black .`
Binary file added docs/logo/logomark-01.png.bkp
Binary file not shown.
5 changes: 0 additions & 5 deletions requirements-test.txt

This file was deleted.

9 changes: 1 addition & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
python-dateutil>=2.6.0
selenium>=3.4.3
six>=1.10.0
python-axolotl
cryptography
typing
numpy
python-magic
-r requirements/base.txt
10 changes: 10 additions & 0 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
python-dateutil>=2.6.0
selenium>=3.4.3
six>=1.10.0
python-axolotl>=0.2.3
cryptography>=2.9.2
typing>=3.7.4.1
numpy>=1.18.4
python-magic>=0.4.18
python-resize-image==1.1.19
Pillow>=7.1.2
7 changes: 7 additions & 0 deletions requirements/development.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-r base.txt
commitizen>=1.22.0
black==19.10b0
flake8
flake8-black==0.2.0
coverage
ipython
File renamed without changes.
Loading

0 comments on commit 7abcdce

Please sign in to comment.