@@ -23,8 +23,8 @@ import sys
23
23
import Pyro4
24
24
from astropy .coordinates import Angle , SkyCoord
25
25
import astropy .units as u
26
+ from rockit .common import print
26
27
from rockit .mount .talon import CommandStatus , TelState , Config
27
- from rockit .common import TFmt
28
28
29
29
SCRIPT_NAME = os .path .basename (sys .argv [0 ])
30
30
@@ -41,7 +41,7 @@ def run_command(command, args):
41
41
files = glob .glob ("/etc/mountd/*.json" )
42
42
if len (files ) != 1 :
43
43
print ('error: failed to guess the default config file. ' +
44
- 'Run as MOUNTD_CONFIG_PATH=/path/to/config.json tel <command> [<args>]' )
44
+ 'Run as MOUNTD_CONFIG_PATH=/path/to/config.json tel <command> \\ [<args>]' )
45
45
return 1
46
46
47
47
config = Config (files [0 ])
@@ -190,7 +190,7 @@ def calibrate(config, args):
190
190
return teld .find_homes ()
191
191
return teld .find_limits ()
192
192
193
- print (f'usage: { SCRIPT_NAME } cal [home|limits]' )
193
+ print (f'usage: { SCRIPT_NAME } cal \\ [home|limits]' )
194
194
return - 1
195
195
196
196
@@ -218,29 +218,29 @@ def status(config, _):
218
218
ra_offset_desc = ''
219
219
ra_offset = Angle (data ['offset_ra' ], unit = u .deg ).to (u .hourangle )
220
220
if ra_offset != 0 :
221
- ra_offset_desc = ' with offset ' + TFmt . Bold + ra_offset .to_string (sep = ':' , precision = 2 ) + TFmt . Clear
221
+ ra_offset_desc = ' with offset [b] ' + ra_offset .to_string (sep = ':' , precision = 2 ) + '[/b]'
222
222
223
223
dec_offset_desc = ''
224
224
dec_offset = Angle (data ['offset_dec' ], unit = u .deg )
225
225
if dec_offset != 0 :
226
- dec_offset_desc = ' with offset ' + TFmt . Bold + dec_offset .to_string (sep = ':' , precision = 2 ) + TFmt . Clear
226
+ dec_offset_desc = ' with offset [b] ' + dec_offset .to_string (sep = ':' , precision = 2 ) + '[/b]'
227
227
228
- moon_desc = TFmt . Bold + f' { data ["moon_separation" ]:.0f} \u00B0 ' + TFmt . Clear
229
- sun_desc = TFmt . Bold + f' { data ["sun_separation" ]:.0f} \u00B0 ' + TFmt . Clear
228
+ moon_desc = f'[b] { data ["moon_separation" ]:.0f} \u00B0 [/b]'
229
+ sun_desc = f'[b] { data ["sun_separation" ]:.0f} \u00B0 [/b]'
230
230
231
- print (' RA is ' + TFmt . Bold + ra_desc + TFmt . Clear + ra_offset_desc )
232
- print (' Dec is ' + TFmt . Bold + dec_desc + TFmt . Clear + dec_offset_desc )
233
- print (' Altitude is ' + TFmt . Bold + alt_desc + TFmt . Clear )
234
- print (' Azimuth is ' + TFmt . Bold + az_desc + TFmt . Clear )
231
+ print (f ' RA is [b] { ra_desc } [/b]' + ra_offset_desc )
232
+ print (f ' Dec is [b] { dec_desc } [/b]' + dec_offset_desc )
233
+ print (f ' Altitude is [b] { alt_desc } [/b]' )
234
+ print (f ' Azimuth is [b] { az_desc } [/b]' )
235
235
print (' Moon separation is ' + moon_desc )
236
236
print (' Sun separation is ' + sun_desc )
237
237
if 'telescope_focus_um' in data :
238
- print (' Telescope focus is ' + TFmt . Bold + f' { data ["telescope_focus_um" ]:.2f} ' + TFmt . Clear + ' um' )
238
+ print (f ' Telescope focus is [b] { data ["telescope_focus_um" ]:.2f} [/b] um' )
239
239
else :
240
- print (' Axes are ' + TFmt . Bold + TFmt . Red + ' NOT HOMED' + TFmt . Clear )
240
+ print (' Axes are [b][red] NOT HOMED[/red][/b]' )
241
241
242
242
lst_desc = Angle (data ['lst' ], unit = u .deg ).to (u .hourangle ).to_string (sep = ':' , precision = 2 )
243
- print (' Local sidereal time is ' + TFmt . Bold + lst_desc + TFmt . Clear )
243
+ print (f ' Local sidereal time is [b] { lst_desc } [/b]' )
244
244
245
245
return 0
246
246
@@ -280,7 +280,7 @@ def ping_teld(config):
280
280
281
281
def print_usage ():
282
282
"""Prints the utility help"""
283
- print (f'usage: { SCRIPT_NAME } <command> [<args>]' )
283
+ print (f'usage: { SCRIPT_NAME } <command> \\ [<args>]' )
284
284
print ()
285
285
print ('general commands:' )
286
286
print (' status print a human-readable summary of the telescope status' )
0 commit comments