Permalink
Browse files

warn when POI.actions is a dict

  • Loading branch information...
1 parent 8e99256 commit b62b4020cd61c3b4947b4c98206bc543eb524d42 @jamesturk committed Mar 3, 2010
Showing with 4 additions and 1 deletion.
  1. +4 −1 layar/__init__.py
View
@@ -66,8 +66,11 @@ def to_dict(self):
d['lon'] = int(self.lon*1000000)
# convert actions dictionary into expected format
- if self.actions:
+ if isinstance(self.actions, dict):
+ raise DeprecationWarning('passing a dictionary for actions is deprecated - order will be lost')
d['actions'] = [{'label':k, 'uri':v} for k,v in self.actions.iteritems()]
+ elif isinstance(self.actions, list):
+ pass
else:
d['actions'] = []

0 comments on commit b62b402

Please sign in to comment.