Skip to content

Commit

Permalink
setup
Browse files Browse the repository at this point in the history
  • Loading branch information
zwwangoo committed Nov 3, 2019
1 parent d5908b0 commit 3e920a7
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 7 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

翻译助手

## Install

```
pip install translate_it
```

## translate it

```
$ translate_it 天气
n. weather
```
7 changes: 7 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[bdist_wheel]
universal=1

[build_sphinx]
all-files = 1
build-dir = docs/_build
warning-is-error = 1
28 changes: 21 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,35 @@
import os

from codecs import open
from setuptools import setup, find_packages

here = os.path.abspath(os.path.dirname(__file__))


requires = [
'requests>=2.22.0',
'lxml>=4.4.1'
]


about = {}
with open(os.path.join(here, 'translate_it', '__version__.py'),
'r', 'utf-8') as f:
exec(f.read(), about)


setup(

name='translate-it',
version='0.1.2',
description='translate it for me.',
name=about['__name__'],
version=about['__version__'],
description=about['__description__'],
python_requires='>=3.5',
author='wen',
author_email='w_angzhiwen@163.com',
url='https://github.com/suadminwen/translate',
license='Apache 2.0',
packages=find_packages(exclude=('tests', 'tests.*')),
zip_safe=False,
author=about['__author__'],
author_email=about['__author_email__'],
url=about['__url__'],
include_package_data=True,
classifiers=[
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
Expand Down
7 changes: 7 additions & 0 deletions translate_it/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
__name__ = 'translate-it'
__version__ = '0.1.3'
__description__ = 'translate it for me.'
__license__ = 'Apache 2.0'
__author__ = 'wen'
__author_email__ = 'w_angzhiwen@163.com'
__url__ = 'https://github.com/suadminwen/translate'
1 change: 1 addition & 0 deletions translate_it/translate_it.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def get_content(words):
res.raise_for_status()
return res.text


def parse(response):
html = etree.HTML(response)
contents = html.xpath('//div[@id="results-contents"]')[0]
Expand Down

0 comments on commit 3e920a7

Please sign in to comment.