Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Commit

Permalink
Added attrdict
Browse files Browse the repository at this point in the history
  • Loading branch information
sirpengi committed Jul 16, 2012
1 parent 23f4e69 commit f17dafe
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions hicap/hicap/utils.py
Expand Up @@ -3,3 +3,10 @@

def to_unixtime(d):
return int(time.mktime(d.timetuple()))

class AttrDict(dict):
def __getattr__(self, key):
return self[key]

def __setattr__(self, key, value):
self[key] = value

0 comments on commit f17dafe

Please sign in to comment.