Skip to content

Commit 71d17e2

Browse files
Removed: distro
1 parent 77fccd9 commit 71d17e2

File tree

4 files changed

+26
-23
lines changed

4 files changed

+26
-23
lines changed

Pipfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ sphinx = "*"
2020

2121
[packages]
2222
apertium-streamparser = "*"
23-
distro = "*"

Pipfile.lock

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apertium/installer.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
from urllib.request import urlretrieve
1010
from zipfile import ZipFile
1111

12-
import distro
13-
1412

1513
class Windows:
1614
"""Download ApertiumWin64 and Move to %localappdata%"""
@@ -132,12 +130,19 @@ def install_language_pack(languages: list = None, install_base: bool = False) ->
132130
if languages is None:
133131
languages = ['apertium-eng', 'apertium-en-es']
134132
apertium_installer = None
135-
if platform.system() == 'Windows':
133+
user_platform = platform.system()
134+
if apertium_installer == 'Windows':
136135
apertium_installer = Windows(languages)
137-
elif distro.name() == 'Ubuntu':
138-
apertium_installer = Ubuntu(languages)
136+
elif apertium_installer == 'Linux':
137+
distro_name = ''
138+
with open('/etc/os-release') as os_release:
139+
distro_name = os_release.readline().split('"')[-1]
140+
if distro_name == 'Ubuntu':
141+
apertium_installer = Ubuntu(languages)
142+
else:
143+
raise ValueError('Installation on {} not supported'.format(distro_name))
139144
else:
140-
raise ValueError('Installation on {} not supported'.format(distro.name()))
145+
raise ValueError('{} is not supported'.format(apertium_installer))
141146
if install_base:
142147
apertium_installer.install_apertium_base()
143148
apertium_installer.install_apertium_language()

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ def _post_install():
2525
python_requires='>=3.4',
2626
install_requires=[
2727
'apertium-streamparser==5.0.2',
28-
'distro',
2928
],
3029
test_suite='tests',
3130
package_data={'apertium': ['py.typed']},

0 commit comments

Comments
 (0)