How to use the anypytools.tools.define2str function in anypytools

To help you get started, we’ve selected a few anypytools examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AnyBody-Research-Group / AnyPyTools / tests / test_tools.py View on Github external
def test_define2str():
    assert define2str('test',2) == '-def test="2"'
    assert define2str('Test','Main.MyStudy') == '-def Test="Main.MyStudy"'
    assert define2str('test','"This is a string"') == '-def test=---"\\"This is a string\\""'
github AnyBody-Research-Group / AnyPyTools / tests / test_tools.py View on Github external
def test_define2str():
    assert define2str('test',2) == '-def test="2"'
    assert define2str('Test','Main.MyStudy') == '-def Test="Main.MyStudy"'
    assert define2str('test','"This is a string"') == '-def test=---"\\"This is a string\\""'
github AnyBody-Research-Group / AnyPyTools / tests / test_tools.py View on Github external
def test_define2str():
    assert define2str('test',2) == '-def test="2"'
    assert define2str('Test','Main.MyStudy') == '-def Test="Main.MyStudy"'
    assert define2str('test','"This is a string"') == '-def test=---"\\"This is a string\\""'
github AnyBody-Research-Group / AnyPyTools / anypytools / macroutils.py View on Github external
def get_macro(self, index, **kwarg):
        cmd = ['load "{}"'.format(self.filename)]

        for key in sorted(self.defs):
            value = self.defs[key]
            cmd.append(define2str(key, value))
        for key in sorted(self.paths):
            value = self.paths[key]
            cmd.append(path2str(key, value))

        return " ".join(cmd)