Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1#!/usr/local/bin/python 

2# encoding: utf-8 

3""" 

4*The dryx tab for the PESSTO Object tickets* 

5 

6:Author: 

7 David Young 

8""" 

9import sys 

10import os 

11import re 

12import datetime 

13import khufu 

14 

15 

16def dryx_tab( 

17 log, 

18 request, 

19 discoveryDataDictionary, 

20 objectAkas, 

21 atelData, 

22 objectHistories): 

23 """dryx tab 

24 

25 **Key Arguments** 

26 

27 - ``log`` -- logger 

28 - ``request`` -- the pyramid request 

29 - ``discoveryDataDictionary`` -- the unique discoveryData dictionary of the object in the pessto marshall database (from view_object_contextual_data) 

30 - ``objectAkas`` -- object akas 

31 - ``objectHistories`` -- the lightcurve data for the objects displayed on the webpage 

32 - ``atelData`` -- the atel matches for the objects displayed on the webpage 

33 

34 

35 **Return** 

36 

37 - ``dryx_tab`` -- for each transient ticket in the transient listings pages 

38 

39 """ 

40 from time import strftime 

41 from marshall_webapp.templates.commonelements.tickets.single_ticket import ticket_building_blocks, tabs 

42 from marshall_webapp.templates.commonelements.tickets import single_ticket 

43 from marshall_webapp.templates.commonelements import forms 

44 

45 log.debug('starting the ``dryx_tab`` function') 

46 

47 group = "" 

48 for item in request.effective_principals: 

49 if "group:" in item: 

50 group = item.replace("group:", "") 

51 if group not in ["superadmin"]: 

52 return None 

53 

54 lastReviewedMag = discoveryDataDictionary["lastReviewedMag"] 

55 lastReviewDate = discoveryDataDictionary["lastReviewedMagDate"] 

56 currentMagnitudeDate = discoveryDataDictionary["currentMagnitudeDate"] 

57 currentMagnitudeEstimate = discoveryDataDictionary[ 

58 "currentMagnitudeEstimate"] 

59 

60 # ADD TEXT COLOR 

61 currentMagnitude = khufu.coloredText( 

62 text="currentMagnitudeEstimate: %(currentMagnitudeEstimate)s (%(currentMagnitudeDate)s)" % locals( 

63 ), 

64 color="grey", 

65 size=3, # 1-10 

66 pull=False, # "left" | "right", 

67 addBackgroundColor=False 

68 ) 

69 

70 # ADD TEXT COLOR 

71 lastReviewedMag = khufu.coloredText( 

72 text="lastReviewMag: %(lastReviewedMag)s (%(lastReviewDate)s)" % locals( 

73 ), 

74 color="grey", 

75 size=3, # 1-10 

76 pull=False, # "left" | "right", 

77 addBackgroundColor=False 

78 ) 

79 

80 dryx_tab = single_ticket._ticket_tab_template( 

81 log, 

82 request=request, 

83 tabHeader=False, 

84 blockList=[lastReviewedMag, currentMagnitude], 

85 tabFooter=False, 

86 htmlId="dryxtab" 

87 ) 

88 

89 log.debug('completed the ``dryx_tab`` function') 

90 return dryx_tab 

91 

92# xt-def-with-logger