Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
Parse a string of the form '<x, y, z>' or 'x, y, z' and return a Vector3.
Will raise a ValueError

            @staticmethod
    def parse(s):
        """Parse a string of the form '' or 'x, y, z' and return a Vector3.
        Will raise a ValueError
        """
        s = s.replace('<', '').replace('>', '')
        dims = s.split(',')
        if len(dims) != 3:
            raise ValueError("Expected 3 values in string")

        x, y, z = [float(d.strip()) for d in dims]
        return Vector3(X=x, Y=y, Z=z)
        


src/p/y/pyogp.lib.client-0.1/pyogp/lib/client/namevalue.py   pyogp.lib.client(Download)
        elif self.value_type == NameValueType.Vector3:
            try:
                self.value = Vector3.parse(value)
            except ValueError:
                self.value = Vector3(X=0, Y=0, Z=0)