commit 71d17e2bbc7f750511d0cb8c8022455852766569 Author: vaydheesh Date: Fri Jul 19 15:46:46 2019 +0530 Removed: distro diff --git a/Pipfile b/Pipfile index cc52dee..ef46445 100644 --- a/Pipfile +++ b/Pipfile @@ -20,4 +20,3 @@ sphinx = "*" [packages] apertium-streamparser = "*" -distro = "*" diff --git a/Pipfile.lock b/Pipfile.lock index 7c85120..094d9c3 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "c66a1d9a8db13b9264dc5c28e2031c35c240f4d6a2d8f4424d7e0abc8b61a53a" + "sha256": "f3c0d4b2a7f1f81a6b8c819e094e4bbb2df663ee1d66437003e788f9930af28d" }, "pipfile-spec": 6, "requires": {}, @@ -21,14 +21,6 @@ ], "index": "pypi", "version": "==5.0.2" - }, - "distro": { - "hashes": [ - "sha256:362dde65d846d23baee4b5c058c8586f219b5a54be1cf5fc6ff55c4578392f57", - "sha256:eedf82a470ebe7d010f1872c17237c79ab04097948800029994fa458e52fb4b4" - ], - "index": "pypi", - "version": "==1.4.0" } }, "develop": { @@ -41,10 +33,10 @@ }, "attrs": { "hashes": [ - "sha256:10cbf6e27dbce8c30807caf056c8eb50917e0eaafe86347671b57254006c3e69", - "sha256:ca4be454458f9dec299268d472aaa5a11f67a4ff70093396e1ceae9c76cf4bbb" + "sha256:69c0dbf2ed392de1cb5ec704444b08a5ef81680a61cb899dc08127123af36a79", + "sha256:f0b870f674851ecbfbbbd364d6b5cbdff9dcedbc7f3f5e18a6891057f21fe399" ], - "version": "==18.2.0" + "version": "==19.1.0" }, "babel": { "hashes": [ @@ -181,12 +173,12 @@ }, "flake8-eradicate": { "hashes": [ - "sha256:0953cd3bcae4bfd04d45075234e0b5fd465ff50ecc56cdcaf0027da751632127", - "sha256:c762fbb5c3e3694c9ba656d38477b2dcca6599b8baeee4984d05d655591a6f83" + "sha256:86804c682f9805a689379307939f350140fe9c015c3e600baff37fb23f7f21cc", + "sha256:cc2c3300a6643f8347988cc828478c347975f7bf9c8fc1f8a7027da41ab9bdbd" ], "index": "pypi", "markers": "python_version > '3.5'", - "version": "==0.2.0" + "version": "==0.2.1" }, "flake8-import-order": { "hashes": [ @@ -435,6 +427,14 @@ ], "version": "==1.4.0" }, + "typing-extensions": { + "hashes": [ + "sha256:2ed632b30bb54fc3941c382decfd0ee4148f5c591651c9272473fea2c6397d95", + "sha256:b1edbbf0652660e32ae780ac9433f4231e7339c7f9a8057d0f042fcbcea49b87", + "sha256:d8179012ec2c620d3791ca6fe2bf7979d979acdbef1fca0bc56b37411db682ed" + ], + "version": "==3.7.4" + }, "urllib3": { "hashes": [ "sha256:b246607a25ac80bedac05c6f282e3cdaf3afb65420fd024ac94435cabe6e18d1", diff --git a/apertium/installer.py b/apertium/installer.py index 88c8f27..dfec30b 100644 --- a/apertium/installer.py +++ b/apertium/installer.py @@ -9,8 +9,6 @@ from typing import Optional from urllib.request import urlretrieve from zipfile import ZipFile -import distro - class Windows: """Download ApertiumWin64 and Move to %localappdata%""" @@ -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() diff --git a/setup.py b/setup.py index dd9aa98..6912a67 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,6 @@ setup( python_requires='>=3.4', install_requires=[ 'apertium-streamparser==5.0.2', - 'distro', ], test_suite='tests', package_data={'apertium': ['py.typed']},