Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.apo.nmsu.edu/Telescopes/TCC/html/show_object_8py_source.html
Дата изменения: Tue Sep 15 02:25:37 2015
Дата индексирования: Sun Apr 10 02:09:44 2016
Кодировка:

Поисковые слова: annular solar eclipse
lsst.tcc: python/tcc/cmd/showObject.py Source File
lsst.tcc  1.2.2-3-g89ecb63
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
showObject.py
Go to the documentation of this file.
1 from __future__ import division, absolute_import
2 
3 from tcc.msg import writerFromObjBlock, computedFields, objFieldKWDict
4 
5 __all__ = ["showObject"]
6 
7 def showObject(tccActor, userCmd):
8  """!Implement the "show object" command
9 
10  @param[in,out] tccActor tcc actor
11  reads tccActor.obj
12  @param[in,out] userCmd user command; if showFull is None then parsedCmd attribute must be set
13  """
14  if userCmd.parsedCmd.qualDict['full'].boolValue:
15  # show all
16  showObjectFields(tccActor, userCmd, showFull=True)
17  else:
18  # show all (except computed)
19  showObjectFields(tccActor, userCmd, showFull=False)
20  userCmd.setState(userCmd.Done)
21 
22 def showObjectFields(tccActor, userCmd, showFull=None):
23  """!Write fields from the object block
24 
25  @param[in,out] tccActor tcc actor
26  reads tccActor.obj
27  @param[in,out] userCmd user command that this output should be associated with
28  @param[in] showFull:
29  If None, show only changed fields (and others that may be grouped with a changed field)
30  If False, show user-set values
31  If True, show all parameters
32  """
33  if showFull is None:
34  # show only updated keywords
35  updatedKWs = writerFromObjBlock.updateBlock(tccActor.obj)
36  writerFromObjBlock.writeKWs(tccActor.writeToUsers, userCmd, updatedKWs)
37  elif showFull:
38  # show all keywords
39  writerFromObjBlock.writeKWs(tccActor.writeToUsers, userCmd)
40  else:
41  # show all keywords except computed
42  # list cast necessary because writeKWs checks is sequence
43  # and apparanetly a set is not a sequence
44  showKWs = list(set(objFieldKWDict.keys()) - computedFields)
45  writerFromObjBlock.writeKWs(tccActor.writeToUsers, userCmd, showKWs)
46 
def showObjectFields
Write fields from the object block.
Definition: showObject.py:22
def showObject
Implement the "show object" command.
Definition: showObject.py:7