Files
DemonEditor/app/eparser/__init__.py

45 lines
1.7 KiB
Python
Raw Normal View History

2018-01-04 20:58:22 +03:00
from app.commons import run_task
2018-01-01 23:42:40 +03:00
from app.properties import Profile
2018-05-12 11:47:19 +03:00
from .ecommons import Service, Satellite, Transponder, Bouquet, Bouquets, is_transponder_valid
2018-01-01 17:28:19 +03:00
from .enigma.blacklist import get_blacklist, write_blacklist
2018-01-01 23:42:40 +03:00
from .enigma.bouquets import get_bouquets as get_enigma_bouquets, write_bouquets as write_enigma_bouquets, to_bouquet_id
from .enigma.lamedb import get_services as get_enigma_services, write_services as write_enigma_services
2017-12-08 18:32:28 +03:00
from .iptv import parse_m3u
2018-01-02 17:38:01 +03:00
from .neutrino.bouquets import get_bouquets as get_neutrino_bouquets, write_bouquets as write_neutrino_bouquets
from .neutrino.services import get_services as get_neutrino_services, write_services as write_neutrino_services
2018-01-01 17:28:19 +03:00
from .satxml import get_satellites, write_satellites
2018-06-01 11:16:30 +03:00
def get_services(data_path, profile, format_version):
2018-01-01 23:42:40 +03:00
if profile is Profile.ENIGMA_2:
2018-06-01 11:16:30 +03:00
return get_enigma_services(data_path, format_version)
2018-01-01 23:42:40 +03:00
elif profile is Profile.NEUTRINO_MP:
return get_neutrino_services(data_path)
2018-01-01 17:28:19 +03:00
2018-01-04 20:58:22 +03:00
@run_task
2018-06-01 17:45:26 +03:00
def write_services(path, channels, profile, format_version):
2018-01-01 23:42:40 +03:00
if profile is Profile.ENIGMA_2:
2018-06-01 17:45:26 +03:00
write_enigma_services(path, channels, format_version)
2018-01-01 23:42:40 +03:00
elif profile is Profile.NEUTRINO_MP:
write_neutrino_services(path, channels)
def get_bouquets(path, profile):
if profile is Profile.ENIGMA_2:
return get_enigma_bouquets(path)
elif profile is Profile.NEUTRINO_MP:
return get_neutrino_bouquets(path)
2018-01-04 20:58:22 +03:00
@run_task
2018-01-01 23:42:40 +03:00
def write_bouquets(path, bouquets, profile):
if profile is Profile.ENIGMA_2:
write_enigma_bouquets(path, bouquets)
elif profile is Profile.NEUTRINO_MP:
write_neutrino_bouquets(path, bouquets)
2017-10-09 22:19:51 +03:00
if __name__ == "__main__":
pass