Changeset 546:2928037f9a75 in documentViewer for SrvTxtUtils.py


Ignore:
Timestamp:
Aug 28, 2012, 6:24:01 PM (12 years ago)
Author:
casties
Branch:
default
Message:

ASSIGNED - # 249: Annotations shared in groups
https://it-dev.mpiwg-berlin.mpg.de/tracs/mpdl-project-software/ticket/249

File:
1 edited

Legend:

Unmodified
Added
Removed
  • SrvTxtUtils.py

    r528 r546  
    1212
    1313
    14 srvTxtUtilsVersion = "1.4.1"
     14srvTxtUtilsVersion = "1.5"
    1515
    1616def getInt(number, default=0):
     
    3838            return s.decode('latin-1')
    3939    else:
    40         return unicode(s)
     40        return s
    4141
    4242def utf8ify(s):
     
    4848        return s
    4949    else:
    50         return unicode(s).encode('utf-8')
     50        return s.encode('utf-8')
    5151
    5252def getText(node, recursive=0):
     
    7676
    7777
    78 def getHttpData(url, data=None, num_tries=3, timeout=10):
     78def getHttpData(url, data=None, num_tries=3, timeout=10, noExceptions=False):
    7979    """returns result from url+data HTTP request"""
    8080    # we do GET (by appending data to url)
     
    117117        return data
    118118   
     119    if noExceptions:
     120        return None
     121   
    119122    raise IOError("ERROR fetching HTTP data from %s: %s"%(url,errmsg))
    120123    #return None
Note: See TracChangeset for help on using the changeset viewer.