Commit d7e05bd6 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Fix configparser

parent 4fd99e25
......@@ -5,10 +5,10 @@ import logging
from astropy.coordinates import SkyCoord, AltAz
from astropy import units as u
from configparser import ConfigParser
import os.path
config = ConfigParser()
config.read('telescope.ini')
print(config.keys())
config.readfp(open(os.path.join(os.path.dirname(__file__), 'telescope.ini')))
class telescope():
def __init__(self, setmode=None, consoleHost=None):
......@@ -21,14 +21,16 @@ class telescope():
self.setmode = setmode
self.readsocketj2000 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.readsocketj2000.connect((config['Console']['HostName'],
config['Console']['Port_Read_J2000']))
self.readsocketj2000.connect((config.get('Console','HostName'),
config.getint('Console','Port_Read_J2000')))
self.outsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
if self.setmode == 'J2000':
self.outsocket.connect((host, setport_j2000))
self.outsocket.connect((config.get('Console','HostName'),
config.getint('Console','Port_Write_J2000')))
elif self.setmode == 'AZEL':
self.outsocket.connect((host, setport_azel))
self.outsocket.connect((config.get('Console','HostName'),
config.getint('Console','Port_Write_AzEl')))
def getRaDec(self):
'''
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment