home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / fnb101.zip / Lib / site-packages / Fnorb / parser / Prefix.py < prev    next >
Text File  |  1999-06-28  |  2KB  |  74 lines

  1. #!/usr/bin/env python
  2. #############################################################################
  3. # Copyright (C) DSTC Pty Ltd (ACN 052 372 577) 1997, 1998, 1999
  4. # All Rights Reserved.
  5. #
  6. # The software contained on this media is the property of the DSTC Pty
  7. # Ltd.  Use of this software is strictly in accordance with the
  8. # license agreement in the accompanying LICENSE.HTML file.  If your
  9. # distribution of this software does not contain a LICENSE.HTML file
  10. # then you have no rights to use this software in any manner and
  11. # should contact DSTC at the address below to determine an appropriate
  12. # licensing arrangement.
  13. #      DSTC Pty Ltd
  14. #      Level 7, GP South
  15. #      Staff House Road
  16. #      University of Queensland
  17. #      St Lucia, 4072
  18. #      Australia
  19. #      Tel: +61 7 3365 4310
  20. #      Fax: +61 7 3365 4311
  21. #      Email: enquiries@dstc.edu.au
  22. # This software is being provided "AS IS" without warranty of any
  23. # kind.  In no event shall DSTC Pty Ltd be liable for damage of any
  24. # kind arising out of or in connection with the use or performance of
  25. # this software.
  26. #
  27. # Project:      Fnorb
  28. # File:         $Source: /units/arch/src/Fnorb/parser/RCS/Prefix.py,v $
  29. # Version:      @(#)$RCSfile: Prefix.py,v $ $Revision: 1.4 $
  30. #
  31. #############################################################################
  32. """ A class to represent IDL prefixes! """
  33.  
  34.  
  35. class Prefix:
  36.  
  37.     def __init__(self, pragma="", prefix=""):
  38.     """ Constructor. """
  39.  
  40.     self.__pragma = pragma
  41.     self.__prefix = prefix
  42.  
  43.     return
  44.  
  45.     def __str__(self):
  46.  
  47.     if len(self.__pragma) > 0:
  48.         result = "%s/%s" % (self.__pragma, self.__prefix)
  49.  
  50.     else:
  51.         result = self.__prefix
  52.  
  53.     return result
  54.  
  55.     __repr__ = __str__
  56.  
  57.     def get_prefix(self):
  58.     return self.__prefix
  59.  
  60.     def set_prefix(self, prefix):
  61.     self.__prefix = prefix
  62.     return
  63.  
  64.     def get_pragma(self):
  65.     return self.__pragma
  66.  
  67.     def set_pragma(self, pragma):
  68.     self.__pragma = pragma
  69.     return
  70.  
  71. #############################################################################
  72.