Skip to content

Commit d8007c2

Browse files
committed
Merging dev branch
2 parents 219f304 + 834f9f3 commit d8007c2

25 files changed

Lines changed: 1130 additions & 147 deletions

.coveragerc

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[run]
2+
branch = False
3+
4+
omit =
5+
# omit the following directory
6+
*/pbr/*
7+
*/site-packages/*
8+
/home/travis/virtualenv/*
9+
*.eggs/*
10+
11+
[report]
12+
# This should be False one we move into production
13+
skip_covered = True
14+
15+
# Regexes for lines to exclude from consideration
16+
exclude_lines =
17+
# Have to re-enable the standard pragma
18+
pragma: no cover
19+
20+
# Don't complain about missing debug-only code:
21+
def __repr__
22+
if self\.debug
23+
24+
# Don't complain if tests don't hit defensive assertion code:
25+
raise AssertionError
26+
raise NotImplementedError
27+
28+
# Don't complain if non-runnable code isn't run:
29+
if __name__ == .__main__.:
30+
31+
32+
ignore_errors = True
33+
34+
[html]
35+
directory = coverage_html_report

.coveralls.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
repo_token: wGjNM0oWvVwoLfOsIvQe3Ya11Jnskx1TT

.travis.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
env:
2+
global:
3+
- PYFUNCEBLE_AUTO_CONFIGURATION: PyFunceble
4+
5+
language: python
6+
7+
python:
8+
- "3.6"
9+
- "3.6.5"
10+
11+
os:
12+
- linux
13+
#- osx
14+
15+
matrix:
16+
fast_finish: true
17+
18+
addons:
19+
apt_packages:
20+
- pandoc
21+
22+
install:
23+
- pip3 install --upgrade pip
24+
- pip3 install pylint coverage coveralls
25+
26+
script:
27+
- coverage run setup.py test && python3 setup.py install
28+
- domain2idna -d аррӏе.com
29+
- domain2idna -f .travis/list_of_domain
30+
- echo "Tests linting " && pylint tests/*.py && echo "domain2idna linting" && pylint domain2idna
31+
32+
after_success:
33+
- coveralls
34+
35+
notifications:
36+
on_success: change
37+
on_failure: always

.travis/list_of_domain

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
lifehacĸer.com
2+
möli.com
3+
müller.de
4+
teeniemösen.com
5+
teenmädchen.com
6+
tegelhof-rügen.de
7+
# This is a commented line in the middle of nowhere
8+
telefonkönig.de
9+
tennisschläger-tennissaiten.de
10+
tierhäuser.de
11+
tinipó.hu
12+
trädgårdsväxter.com
13+
transenschwänze.com
14+
traumfüsse.com
15+
türkei-antik.de
16+
# This is a commented line with äüéáóṕĺẃéŕźúíóṕáśǵḱĺýćǘnḿ
17+
türkenboy.com
18+
türkenboys.com
19+
türkenmösen.com
20+
türkischeboys.com
21+
türkischelolita.com
22+
zorlasikiş.com
23+
züri.ch
24+
аррӏе.com
25+
援交.com
26+
短.co

README

Lines changed: 0 additions & 22 deletions
This file was deleted.

README.md

Lines changed: 50 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,70 @@
11
# domains2idna
22

3-
## A tool to convert a domain or a file with a list of domain to the famous IDNA format.
3+
## The tool to convert domains to the famous IDNA format.
4+
5+
[![Build Status](https://travis-ci.com/funilrys/domain2idna.svg?branch=dev)](https://travis-ci.com/funilrys/domain2idna) [![Coverage Status](https://coveralls.io/repos/github/funilrys/domain2idna/badge.svg?branch=dev)](https://coveralls.io/github/funilrys/domain2idna?branch=dev) [![license](https://img.shields.io/github/license/funilrys/domain2idna.svg)](https://github.com/funilrys/domain2idna/blob/dev/LICENSE) [![GitHub release](https://img.shields.io/github/release/funilrys/domain2idna.svg)](https://github.com/funilrys/domain2idna/releases/latest) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
6+
7+
The objective of this project is to provide a tool for list or hosts file maintainer that can convertible domain to the Punycode/IDNA format.
48

59
* * *
610

7-
# Tests
11+
## Documentation as the place to be!
812

9-
```shell
10-
# The following run the tests.
11-
$ python setup.py test
12-
```
13+
Want to know more about **domain2idna**?
14+
We invite you to read the documentation at https://domain2idna.readthedocs.io!
1315

14-
# Installation
16+
Want a local copy!? We get you covered!
1517

16-
You can install domain2idna with two ways.
18+
Simply run the following and enjoy the documentation!
1719

18-
```shell
19-
# This install domain2idna without having to manually clone the repository
20-
$ pip install git+https://github.com/funilrys/domain2idna.git#egg=domain2idna
2120
```
22-
23-
```shell
24-
# This install all dependencies along with domain2idna after you cloned the repository.
25-
# Usage: developement only.
26-
$ pip install -e .
21+
$ # We move to the docs directory
22+
$ cd docs/
23+
$ # We build the documentation
24+
$ make html
25+
$ # We run the documentation with our favorite browser.
26+
$ chromium _builld/html/index.html
2727
```
2828

29-
# Usage
30-
31-
## Import
32-
33-
```python
34-
#!/usr/bin/env python3
35-
36-
"""
37-
This module uses domains2idna to convert a given domain.
29+
## Main Features
3830

39-
Author:
40-
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
31+
- Read a given domain and convert it to the Punycode/IDNA format.
32+
- Read a file and convert all non-commented line to the Punycode/IDNA format.
33+
- Print the converted data on the screen.
34+
- Save into a file the converted data.
35+
- Return the converted data (when used as a module).
36+
- Ignore commented inputs (starts with `#`)
4137

42-
Contributors:
43-
Let's contribute to this example!!
38+
## Supporting the project
4439

45-
Repository:
46-
https://github.com/funilrys/domain2idna
47-
"""
40+
[domain2idna](https://github.com/funilrys/domain2idna), [PyFunceble](https://github.com/funilrys/PyFunceble), [Dead-Hosts](https://github.com/dead-hosts), [Funceble](https://github.com/funilrys/funceble) and all other analog projects are or were powered by :coffee:!
4841

49-
from colorama import Style
50-
from colorama import init as initiate
42+
This project helps you and or you like it?
5143

52-
from domain2idna.core import Core
44+
[![Help me with a cup of coffee](https://img.shields.io/badge/Help%20me%20out-with%20a%20cup%20of%20%E2%98%95%20-blue.svg)](https://www.paypal.me/funilrys/)
5345

54-
DOMAINS = [
55-
"bittréẋ.com", "bịllogram.com", "coinbȧse.com", "cryptopiạ.com", "cṙyptopia.com"
56-
]
46+
## License
5747

58-
# We activate the automatical reset of string formatting
59-
initiate(True)
60-
61-
# The following return the result of the whole loop.
62-
print(
63-
"%sList of converted domains:%s %s"
64-
% (Style.BRIGHT, Style.RESET_ALL, Core(DOMAINS).to_idna())
65-
)
66-
67-
# The following return the result of only one element.
68-
print(
69-
"%sString representing a converted domain:%s %s"
70-
% (Style.BRIGHT, Style.RESET_ALL, Core(DOMAINS[-1]).to_idna())
71-
)
7248
```
73-
74-
## Command-Line
75-
76-
usage: domain2idna [-h] [-d DOMAIN] [-f FILE] [-o OUTPUT]
77-
78-
domain2idna - A tool to convert a domain or a file with a list of domain to
79-
the famous IDNA format.
80-
81-
optional arguments:
82-
-h, --help show this help message and exit
83-
-d DOMAIN, --domain DOMAIN
84-
Set the domain to convert.
85-
-f FILE, --file FILE Set the domain to convert.
86-
-o OUTPUT, --output OUTPUT
87-
Set the file where we write the converted domain(s).
88-
89-
Crafted with ♥ by Nissar Chababy (Funilrys)
49+
MIT License
50+
51+
Copyright (c) 2018 Nissar Chababy
52+
53+
Permission is hereby granted, free of charge, to any person obtaining a copy
54+
of this software and associated documentation files (the "Software"), to deal
55+
in the Software without restriction, including without limitation the rights
56+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
57+
copies of the Software, and to permit persons to whom the Software is
58+
furnished to do so, subject to the following conditions:
59+
60+
The above copyright notice and this permission notice shall be included in all
61+
copies or substantial portions of the Software.
62+
63+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
64+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
65+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
66+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
67+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
68+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
69+
SOFTWARE.
70+
```

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SPHINXPROJ = domain2idna
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/code.rst

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Code documentation
2+
==================
3+
4+
.. automodule:: domain2idna
5+
:members: get
6+
7+
Helpers
8+
-------
9+
10+
Problematic
11+
^^^^^^^^^^^
12+
13+
How can we write, read and delete a file without having to write everytime the same thing?
14+
15+
Code documentation
16+
^^^^^^^^^^^^^^^^^^
17+
18+
.. automodule::domain2idna.helpers
19+
:members:
20+
21+
22+
:code:`File()`
23+
""""""""""""""
24+
25+
.. autoclass:: domain2idna.helpers.File
26+
:members:
27+
28+
29+
Core
30+
----
31+
32+
Code documentation
33+
^^^^^^^^^^^^^^^^^^
34+
35+
.. automodule::domain2idna.core
36+
:members:
37+
38+
.. autoclass:: domain2idna.core.Core
39+
:members:

0 commit comments

Comments
 (0)