import httplib, urllib, socket
import md5

def getConditionText(condition):
  if condition is not None:
    return condition.text

def postSMS(content, phonens):
  pass

def checkSMSGateway():
  return False
    
def getLightningLocationOrElectricFieldData(start, end, action):
  return ''
  
def getMD5HexDigest(string):
  a = md5.md5()
  a.update(string)
  return a.hexdigest()

from Products.ERP5Type.TransactionalVariable import getTransactionalVariable
def setTransactionalCache(key, value):
  tv = getTransactionalVariable()
  tv[key] = value
def getTransactionalCache(key):
  tv = getTransactionalVariable()
  try:
    return tv[key]
  except KeyError:
    return None
