コード例 #1
0
    def test_getters(self):
        self.assertEqual(self.param.get_key(), "pluginid")
        self.assertEqual(self.param.get_name(), "The Plugin Name")
        self.assertEqual(self.param.get_descr(),
                         "Performs something on some files.")
        self.assertEqual(self.param.get_icon(), "")

        opt = self.param.get_options()
        self.assertEqual(len(opt), 3)

        self.assertEqual(opt[0].get_key(), "-b")
        self.assertEqual(opt[1].get_key(), "--show-progress")
        self.assertEqual(opt[2].get_key(), "-i")
        self.assertEqual(opt[2].get_value(), u('C:\Windows'))
コード例 #2
0
def _(message):
    return u(msg(message, "ui"))
コード例 #3
0
def _info(msg_id):
    return u(info(msg_id, "annotations"))
コード例 #4
0
ファイル: marsatagplugin.py プロジェクト: engiwip/sppas
command += ' --writer-option keep-input-tiers=false '
command += ' -out-ext -pos.TextGrid '
command += ' --oral '
command += ' -M -P -Q '
command += ' "' + os.path.abspath(filename) + '" '
command_args = shlex.split(command)

p = Popen(command_args, shell=False, stdout=PIPE, stderr=STDOUT)
message = p.communicate()[0]

if message is not None:

    # Marsatag 0.8.5 is using marsatag.home instead of ortolang.home,
    # without retro-compatibility.

    message = u(message)
    if "Can't found morpholexical dictionnary" in message:

        command = command.replace("-Dortolang", "-Dmarsatag")
        command_args = shlex.split(command)
        p = Popen(command_args, shell=False, stdout=PIPE, stderr=STDOUT)
        message = p.communicate()[0]
        if message is not None:
            message = u(message)

if message is None:
    print("Done.")

else:
    print(b(message))