Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't create an empty Observer unless it's needed

  • Loading branch information...
commit 58a04e6fe2ee94097be3e12816a1f2c4cd6fcf0a 1 parent 13c6d44
@akkana authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 analemma.py
View
4 analemma.py
@@ -179,11 +179,10 @@ def show_window(self, observer) :
gtk.main()
if __name__ == "__main__" :
- observer = ephem.Observer()
-
if len(sys.argv) == 2 :
observer = ephem.city(sys.argv[1])
elif len(sys.argv) == 3 :
+ observer = ephem.Observer()
observer.name = "custom"
observer.lon = sys.argv[1]
observer.lat = sys.argv[2]
@@ -191,6 +190,7 @@ def show_window(self, observer) :
# default to San Jose
# pyephem doesn't know ephem.city('San Jose')
# Houge Park is -121^56.53' 37^15.38'
+ observer = ephem.Observer()
observer.name = "San Jose"
observer.lon = '-121:56.8'
observer.lat = '37:15.55'
Please sign in to comment.
Something went wrong with that request. Please try again.