VisionEgg.PyroApps.VarTypes

Package VisionEgg :: Package PyroApps :: Module VarTypes |
[frames] | no frames]

# Source Code for Module VisionEgg.PyroApps.VarTypes

     1  # The Vision Egg: VarTypes
     2  #
     3  # Copyright (C) 2004 Imran S. Ali, Lachlan Dowd
     4  #
     5  # Author: Imran S. Ali, Lachlan Dowd
     6  # URL: <http://www.visionegg.org/>
     7  #
     8  # Distributed under the terms of the GNU Lesser General Public License
     9  # (LGPL). See LICENSE.TXT that came with this file.
    10  #
    11  # $Id$
    12
    13  # Add your supported supported demo script "variable types" here:
    14
    15 -def getID(var_type):
    16      if var_type == "float":
    17          return 1
    18      elif var_type == "int" or var_type == "integer":
    19          return 2
    20      elif var_type == "string" or var_type == "str":
    21          return 3
    22      else:
    23          return -1
    24
    25 -def getType(ID):
    26      if ID == 1:
    27          return "float"
    28      elif ID == 2:
    29          return "integer"
    30      elif ID == 3:
    31          return "string"
    32      else:
    33          return "undefined type"
    34