Skip to content
Snippets Groups Projects
Select Git revision
  • d1dbfbd52e1311b04d965bdb7adecd50d2ad590b
  • test default protected
  • master protected
  • original
  • pirati-backup protected
  • beta-2
  • beta-1
  • v3.1.4
  • v3.1.3
  • v3.1.2
  • v3.1.1
  • v3.1.0
  • v3.0.16
  • v3.0.15
  • v3.0.14
  • v3.0.13
  • v3.0.12
  • v3.0.11
  • v3.0.10
  • v3.0.9
  • v3.0.8
  • v3.0.7
  • v3.0.6
  • v3.0.5
  • v3.0.4
25 results

django-gae.py

Blame
  • utils.py 468 B
    """
    Some basic utils 
    (previously were in helios module, but making things less interdependent
    
    2010-08-17
    """
    
    import json
    
    ## JSON
    def to_json(d):
      return json.dumps(d, sort_keys=True)
      
    def from_json(json_str):
      if not json_str: return None
      return json.loads(json_str)
      
    def JSONtoDict(json):
        x=json.loads(json)
        return x
        
    def JSONFiletoDict(filename):
      f = open(filename, 'r')
      content = f.read()
      f.close()
      return JSONtoDict(content)