Commits

Richo Healey committed dfd72b5

Presentation should be the concern of a Location

This change brings the output format inline with whereami(1) and also
selfishly serves to make it work with the applications I've already
developed

  • Participants
  • Parent commits 6897227

Comments (0)

Files changed (1)

File doko/__init__.py

 import requests
 import BeautifulSoup
 
-Location = namedtuple('Location', 'latitude longitude')
+class Location(namedtuple('Location', 'latitude longitude')):
+    def __repr__(self):
+        return "%s,%s" % (self.latitude, self.longitude)
 
 DEFAULT_TIMEOUT = 3
 DEFAULT_RETRIES = 10
             print >> sys.stderr, error
         sys.exit(1)
 
-    print ' '.join(map(str, l))
+    print(repr(l))
 
     if options.show:
         webbrowser.open(