dynamic profiles
This commit is contained in:
20
owrx/js8.py
20
owrx/js8.py
@ -3,9 +3,10 @@ from .parser import Parser
|
||||
import re
|
||||
from js8py import Js8
|
||||
from js8py.frames import Js8FrameHeartbeat, Js8FrameCompound
|
||||
from owrx.map import Map, LocatorLocation
|
||||
from owrx.pskreporter import PskReporter
|
||||
from owrx.metrics import Metrics, CounterMetric
|
||||
from .map import Map, LocatorLocation
|
||||
from .pskreporter import PskReporter
|
||||
from .metrics import Metrics, CounterMetric
|
||||
from .config import Config
|
||||
from abc import ABCMeta, abstractmethod
|
||||
|
||||
import logging
|
||||
@ -13,6 +14,19 @@ import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Js8Profiles(object):
|
||||
@staticmethod
|
||||
def getEnabledProfiles():
|
||||
config = Config.get()
|
||||
profiles = config["js8_enabled_profiles"] if "js8_enabled_profiles" in config else []
|
||||
return [Js8Profiles.loadProfile(p) for p in profiles]
|
||||
|
||||
@staticmethod
|
||||
def loadProfile(profileName):
|
||||
className = "Js8{0}Profile".format(profileName[0].upper() + profileName[1:].lower())
|
||||
return globals()[className]()
|
||||
|
||||
|
||||
class Js8Profile(AudioChopperProfile, metaclass=ABCMeta):
|
||||
def getFileTimestampFormat(self):
|
||||
return "%y%m%d_%H%M%S"
|
||||
|
Reference in New Issue
Block a user