コード例 #1
0
    def add_symbol(self, name):

        if name is None:
            raise ValueError("A name must be specified")

        name = str(name).strip()
        if len(name) == 0:
            raise ValueError("A name must be specified")

        x = Serializer.symbol_to_json(self.__project.create_symbol(name=name))
        return x
コード例 #2
0
    def update_symbol(self, sid, name):
        if sid is None:
            raise ValueError("A SID must be specified")

        sid = str(sid).strip()
        if len(sid) == 0:
            raise ValueError("A SID must be specified")

        if name is None:
            raise ValueError("A name must be specified")

        name = str(name).strip()
        if len(name) == 0:
            raise ValueError("A name must be specified")

        return Serializer.symbol_to_json(
            self.__project.update_symbol(sid=sid, name=name))
コード例 #3
0
 def get_symbols(self, limit, offset):
     return [
         Serializer.symbol_to_json(symbol)
         for symbol in self.__project.get_symbols(limit, offset)
     ]