#!/usr/bin/python
# Rotor Control Python Utilities
# Copyright (C) 2006, 2007, 2008, 2009 Leigh L. Klotz, Jr <Leigh@WA5ZNU.org>
# Licensed under Academic Free License 3.0 (See LICENSE)

# TODO:
# Read bearing
# Move XML parsing to library
# Handle "a/b" rotations and talk to steppir

import string, serial, time, sys, math, os, time
from lxml import etree

import rotorlib

rotor = rotorlib.Rotor()
try:
    if len(sys.argv) == 2:
        rotor.rotate(int(sys.argv[1]))
    else:
        print(rotor.rotateq())
finally:
   rotor.close()
