Skip to content

Commit

Permalink
Cleaned-up code, deleted unnecessary classes & version 1.12
Browse files Browse the repository at this point in the history
Imports optimized, checker.py deleted (it was unnecessary), removed exception from errors.py and changed README files. Also modified and updated setup.py and setup.cfg
  • Loading branch information
Javinator9889 committed Aug 14, 2018
1 parent ac42929 commit 142f506
Show file tree
Hide file tree
Showing 12 changed files with 211 additions and 196 deletions.
2 changes: 1 addition & 1 deletion README.md
@@ -1,7 +1,7 @@
# [pyGle](https://github.com/Javinator9889/pyGle)
A tool for searching the entire web with the Google technology

[![PyPi](https://img.shields.io/badge/v1.11%20-PyPi-green.svg)](https://pypi.org/project/g-pyGle/)
[![PyPi](https://img.shields.io/badge/v1.12%20-PyPi-green.svg)](https://pypi.org/project/g-pyGle/)
[![ZIP](https://img.shields.io/badge/Package%20-Zip-blue.svg)](https://github.com/Javinator9889/pyGle/archive/master.zip)
[![GIT](https://img.shields.io/badge/Package%20-Git-red.svg)](https://github.com/Javinator9889/pyGle.git)
[![Downloads](https://pepy.tech/badge/g-pygle)](https://pepy.tech/project/g-pygle)
Expand Down
4 changes: 2 additions & 2 deletions README.rst
@@ -1,4 +1,4 @@
`pyGle <https://github.com/Javinator9889/pyGle>`__
pyGle
==================================================

A tool for searching the entire web with the Google technology
Expand Down Expand Up @@ -322,7 +322,7 @@ If you really appreciate my work, you can *contribute to this project* perfectly
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.`

.. |PyPi| image:: https://img.shields.io/badge/v1.11%20-PyPi-green.svg
.. |PyPi| image:: https://img.shields.io/badge/v1.12%20-PyPi-green.svg
:target: https://pypi.org/project/g-pyGle/
.. |ZIP| image:: https://img.shields.io/badge/Package%20-Zip-blue.svg
:target: https://github.com/Javinator9889/pyGle/archive/master.zip
Expand Down
325 changes: 190 additions & 135 deletions pyGle/.idea/workspace.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyGle/__init__.py
Expand Up @@ -6,7 +6,6 @@
#
__all__ = ['PyGle']

from .url import GoogleSearch, URLBuilder
from .extractor import (BaseExtractor,
ImageExtractor,
SearchExtractor,
Expand All @@ -16,6 +15,7 @@
ShopExtractor,
BookExtractor,
Future)
from .url import GoogleSearch, URLBuilder
from .url.url_constants import __google_url_modifiers__
from .version import print_ver_info

Expand Down
6 changes: 0 additions & 6 deletions pyGle/errors.py
Expand Up @@ -6,12 +6,6 @@
#


class InvalidTimeException(RuntimeError):
def __init__(self, message: str = None):
self.__message = message
super().__init__(message)


class InvalidCombinationException(RuntimeError):
def __init__(self, message: str = None):
self.__message = message
Expand Down
14 changes: 6 additions & 8 deletions pyGle/extractor/__init__.py
Expand Up @@ -4,21 +4,19 @@
# This is free software, and you are welcome to redistribute it
# under certain conditions; type "-L" for details.
#
import lxml
import urllib.request
import urllib.parse
import urllib.error
import ujson as json
import random
import time

from bs4 import BeautifulSoup
import ujson as json
import urllib.error
import urllib.parse
import urllib.request
from concurrent.futures import Future, ThreadPoolExecutor
from multiprocessing import cpu_count

from bs4 import BeautifulSoup
from pyGle.errors import GoogleOverloadedException, GoogleBlockingConnectionsError
from pyGle.url import URLBuilder
from pyGle.url.url_constants import __user_agents__
from pyGle.errors import GoogleOverloadedException, GoogleBlockingConnectionsError


class BaseExtractor:
Expand Down
3 changes: 2 additions & 1 deletion pyGle/url/__init__.py
Expand Up @@ -6,10 +6,11 @@
#
import urllib.parse

from .url_constants import __google_base_url__, __google_url_modifiers__
from pyGle.values import *
from pyGle.values.InterfaceLanguages import InterfaceLanguages

from .url_constants import __google_base_url__, __google_url_modifiers__


class GoogleSearch:
def __init__(self, query: str = None):
Expand Down
34 changes: 0 additions & 34 deletions pyGle/url/checker.py

This file was deleted.

9 changes: 5 additions & 4 deletions pyGle/values/__init__.py
Expand Up @@ -5,10 +5,11 @@
# under certain conditions; type "-L" for details.
#
from pyGle.url.url_constants import __google_url_modifiers__
from .AvailableLanguages import AvailableLanguages

from .AvailableCountries import AvailableCountries
from .OptionsForPictures import *
from .AvailableLanguages import AvailableLanguages
from .OptionsForPatents import *
from .OptionsForPictures import *


class TimeLimit:
Expand Down Expand Up @@ -221,8 +222,8 @@ def setOfficePatent(self, office_patent: OfficePatents):
def setPatentStatus(self, status: PatentStatus):
self.__patents_params["patent_status"] = status

def setPatentType(self, type: AvailablePatentTypes):
self.__patents_params["patent_type"] = type
def setPatentType(self, patent_type: AvailablePatentTypes):
self.__patents_params["patent_type"] = patent_type

def getPatentModifiers(self) -> dict:
return self.__patents_params
Expand Down
4 changes: 2 additions & 2 deletions pyGle/version.py
Expand Up @@ -5,8 +5,8 @@
# under certain conditions; type "-L" for details.
#

__version__ = "v1.11"
__version_code__ = 77
__version__ = "v1.12"
__version_code__ = 80


def print_ver_info():
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
@@ -1,2 +1,2 @@
[metadata]
description-file = README.md, README.rst
description-file = README.md
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -9,7 +9,7 @@
try:
import codecs

readme = codecs.open(filename="README.rst", mode="r", encoding="utf-8")
readme = codecs.open(filename="README.rst", encoding="utf-8")
long_description = readme.read()
readme.close()
except:
Expand Down

0 comments on commit 142f506

Please sign in to comment.