# Path: wh.py
# def xlt(s): # translate
#   return s
#   t=wx.GetTranslation(s)
#   # if dict set and t == s: log untranslated
#   return t
# 
# def YesNo(b):
#   if b:
#     return xlt("Yes")
#   else:
#     return xlt("No")


from _objects import SchemaObject
from _pgsql import pgQuery
from wh import xlt, YesNo
import logger
    return self.GetImageId(icons)


  def GetSql(self):
    definition=self.info.get('definition')
    if not definition:
      definition=self.GetCursor().ExecuteSingle("SELECT pg_get_functiondef(%d)" % self.GetOid())
      self.info['definition']=definition
    return "%(def)s\n%(grant)s" % {
               'object': self.ObjectSql(),
               'def': definition, 'grant': self.GrantCommentSql() }
  

  def GetProperties(self):
    if not len(self.properties):
      args=self.info.get('arguments')
      if args == None:
        logger.error("PGSQL < 8.4; no function args/returns")
        args=""
        self.info['arguments']=""
        self.info['result']=""
      self.info['definition']=None
      result=self.info.get('result', "")
      self.properties = [
        (xlt("Name"),           "%s(%s)" % (self.info['name'], args)),
        (xlt("Namespace"),      self.info['nspname']),
        (xlt("Language"),       self.info['lanname']),
        (xlt("Strict"),         YesNo(self.info['proisstrict'])),
        (    "OID" ,            self.info['oid']),
        (xlt("Returns"),        result),

# Path: wh.py
# def xlt(s): # translate
#   return s
#   t=wx.GetTranslation(s)
#   # if dict set and t == s: log untranslated
#   return t
# 
# def YesNo(b):
#   if b:
#     return xlt("Yes")
#   else:
#     return xlt("No")


# Path: modPg/Function.py
from _objects import SchemaObject
from _pgsql import pgQuery
from wh import xlt, YesNo
import logger

    return self.GetImageId(icons)


  def GetSql(self):
    definition=self.info.get('definition')
    if not definition:
      definition=self.GetCursor().ExecuteSingle("SELECT pg_get_functiondef(%d)" % self.GetOid())
      self.info['definition']=definition
    return "%(def)s\n%(grant)s" % {
               'object': self.ObjectSql(),
               'def': definition, 'grant': self.GrantCommentSql() }
  

  def GetProperties(self):
    if not len(self.properties):
      args=self.info.get('arguments')
      if args == None:
        logger.error("PGSQL < 8.4; no function args/returns")
        args=""
        self.info['arguments']=""
        self.info['result']=""
      self.info['definition']=None
      result=self.info.get('result', "")
      self.properties = [
        (xlt("Name"),           "%s(%s)" % (self.info['name'], args)),
        (xlt("Namespace"),      self.info['nspname']),
        (xlt("Language"),       self.info['lanname']),
        (xlt("Strict"),         YesNo(self.info['proisstrict'])),
        (    "OID" ,            self.info['oid']),
        (xlt("Returns"),        result),

        (xlt("Owner"),          self.info['owner']),