def setUp(self): self._lgs = sppasLogSetup(0) self._lgs.stream_handler() if os.path.exists(TEMP) is True: shutil.rmtree(TEMP) os.mkdir(TEMP) shutil.copytree(os.path.join(DATA, "protos"), os.path.join(TEMP, "protos"))
args = parser.parse_args() # ---------------------------------------------------------------------------- # Main program # ---------------------------------------------------------------------------- # Redirect all messages to logging # -------------------------------- with sppasAppConfig() as cg: if not args.quiet: log_level = cg.log_level else: log_level = cg.quiet_log_level lgs = sppasLogSetup(log_level) lgs.stream_handler() # -------------------------------- if os.path.exists(args.o): model = os.path.join(args.o, "hmmdefs") if os.path.exists(model): print("A model with name {:s} is already existing.".format(args.o)) sys.exit(1) # -------------------------------- logging.info("Train the model...") acm = train(pron_dict=args.r, mapping_table=args.m,
parser.add_argument("files", nargs="*", help='Input audio file name(s)') args = parser.parse_args() # force to add path filenames = [] for f in args.files: p, b = path.split(f) if not p: p = getcwd() filenames.append(path.abspath(path.join(p, b))) # Logging # ---------------------------------------------------------------------------- with sppasAppConfig() as cg: lgs = sppasLogSetup(cg.log_level) lgs.stream_handler() # GUI is here: # ---------------------------------------------------------------------------- sppas = wx.App(redirect=True) # Fix preferences prefsIO = Preferences_IO(SETTINGS_FILE) if prefsIO.Read() is False: prefsIO.SetTheme(sppasTheme()) # Tests if v == '2': message = "The version of WxPython is too old.\n" \
""" def __init__(self): """Wx Application initialization.""" # Initialize the wx application wx.App.__init__(self, redirect=False, filename=None, useBestVisual=True, clearSigInt=True) self.cfg = sppasAppConfig() self.settings = WxAppSettings() # --------------------------------------------------------------------------- lgs = sppasLogSetup(0) lgs.stream_handler() app = testApp() # demo = sppasDialog(None, title="sppasDialog") # demo.CreateHeader("This is a BaseDialog...") # demo.CreateActions([wx.CANCEL], [wx.OK]) # demo.LayoutComponents() # demo.ShowModal() # demo.Destroy() # demo = sppasYesNoDialog("This is a question?") # r = demo.ShowModal() # if r == wx.ID_YES: # print("Click on Yes") # elif r == wx.ID_NO: