Skip to content

Commit

Permalink
Removed: distro
Browse files Browse the repository at this point in the history
  • Loading branch information
singh-lokendra committed Jul 19, 2019
1 parent 77fccd9 commit 71d17e2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 23 deletions.
1 change: 0 additions & 1 deletion Pipfile
Expand Up @@ -20,4 +20,3 @@ sphinx = "*"

[packages]
apertium-streamparser = "*"
distro = "*"
30 changes: 15 additions & 15 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 11 additions & 6 deletions apertium/installer.py
Expand Up @@ -9,8 +9,6 @@
from urllib.request import urlretrieve
from zipfile import ZipFile

import distro


class Windows:
"""Download ApertiumWin64 and Move to %localappdata%"""
Expand Down Expand Up @@ -132,12 +130,19 @@ def install_language_pack(languages: list = None, install_base: bool = False) ->
if languages is None:
languages = ['apertium-eng', 'apertium-en-es']
apertium_installer = None
if platform.system() == 'Windows':
user_platform = platform.system()
if apertium_installer == 'Windows':
apertium_installer = Windows(languages)
elif distro.name() == 'Ubuntu':
apertium_installer = Ubuntu(languages)
elif apertium_installer == 'Linux':
distro_name = ''
with open('/etc/os-release') as os_release:
distro_name = os_release.readline().split('"')[-1]
if distro_name == 'Ubuntu':
apertium_installer = Ubuntu(languages)
else:
raise ValueError('Installation on {} not supported'.format(distro_name))
else:
raise ValueError('Installation on {} not supported'.format(distro.name()))
raise ValueError('{} is not supported'.format(apertium_installer))
if install_base:
apertium_installer.install_apertium_base()
apertium_installer.install_apertium_language()
1 change: 0 additions & 1 deletion setup.py
Expand Up @@ -25,7 +25,6 @@ def _post_install():
python_requires='>=3.4',
install_requires=[
'apertium-streamparser==5.0.2',
'distro',
],
test_suite='tests',
package_data={'apertium': ['py.typed']},
Expand Down

0 comments on commit 71d17e2

Please sign in to comment.