def __init__(self, parent, preferences): """ Constructor. """ wx.lib.scrolledpanel.ScrolledPanel.__init__(self, parent, -1, size=wx.DefaultSize, style=wx.NO_BORDER) self.SetBackgroundColour(preferences.GetValue('M_BG_COLOUR')) # Members self.activated = [] self.step_panels = [] self.linked = False self.parameters = sppasParam() self._prefsIO = preferences self.parameters.set_output_format( self._prefsIO.GetValue('M_OUTPUT_EXT') ) _contentbox = self.__create_content() # Button to annotate runBmp = spBitmap(ANNOTATE_ICON, BUTTON_ICONSIZE, self._prefsIO.GetValue('M_ICON_THEME')) self._brun = CreateGenButton(self, RUN_ID, runBmp, text=" Perform annotations ", tooltip="Automatically annotate selected files.", colour=wx.Colour(220,100,80), SIZE=BUTTON_ICONSIZE, font=self._prefsIO.GetValue('M_FONT')) _vbox = wx.BoxSizer(wx.VERTICAL) _vbox.Add(_contentbox, proportion=2, flag=wx.EXPAND | wx.ALL, border=4) _vbox.Add(self._brun, proportion=0, flag=wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, border=20) self.Bind(wx.EVT_BUTTON, self.on_sppas_run, self._brun, RUN_ID) self.SetSizer(_vbox) self.SetupScrolling(scroll_x=True, scroll_y=True) self.SetMinSize(wx.Size(MIN_PANEL_W,MIN_PANEL_H))
sys.path.append(SPPAS) from sp_glob import program, author, version, copyright, url from annotationdata.io import extensions_out #_multitiers from annotations.param import sppasParam from annotations.process import sppasProcess from term.textprogress import TextProgress from term.terminalcontroller import TerminalController from sp_glob import DEFAULT_OUTPUT_EXTENSION # ---------------------------------------------------------------------------- # Verify and extract args: # ---------------------------------------------------------------------------- parameters = sppasParam() parser = ArgumentParser(usage="%s -w file|folder [options]" % os.path.basename(PROGRAM_PATH), prog=PROGRAM_PATH, description="Automatic annotations command line interface.") parser.add_argument("-w", required=True, metavar="file|folder", help='Input wav file name, or directory') parser.add_argument("-l", metavar="lang", help='Input language, using iso639-3 code') parser.add_argument("-e", default=DEFAULT_OUTPUT_EXTENSION, metavar="extension", help='Output extension. One of: %s'%" ".join(extensions_out)) #_multitiers)) parser.add_argument("--momel", action='store_true', help="Activate Momel" ) parser.add_argument("--intsint", action='store_true', help="Activate INTSINT" ) parser.add_argument("--ipus", action='store_true', help="Activate IPUs Segmentation" ) parser.add_argument("--tok", action='store_true', help="Activate Tokenization" ) parser.add_argument("--phon", action='store_true', help="Activate Phonetization" ) parser.add_argument("--chunks", action='store_true', help="Activate Chunks alignment" ) parser.add_argument("--align", action='store_true', help="Activate Phones alignment" ) parser.add_argument("--syll", action='store_true', help="Activate Syllabification" ) parser.add_argument("--repet", action='store_true', help="Activate Self-Repetitions" )