0 0 1
default
Jean-Francois Pieronne - 5 years ago 2014-10-20 15:18:29
jf.pieronne@laposte.net
Initial version trnlnm.py
1 file changed with 38 insertions and 0 deletions:
↑ Collapse Diff ↑
 
new file 100755
1
 
from vms.starlet import trnlnm
2
 
from vms.itemList import *
3
 
from vms.lnmdef import *
4
 

	
5
 
def show_attr(l_attributes):
6
 
    if (l_attributes & LNM_M_NO_ALIAS):
7
 
        print '  LNM_M_NO_ALIAS'
8
 
    if (l_attributes & LNM_M_CONFINE):
9
 
        print '  LNM_M_CONFINE'
10
 
    if (l_attributes & LNM_M_CRELOG):
11
 
        print '  LNM_M_CRELOG'
12
 
    if (l_attributes & LNM_M_TABLE):
13
 
        print '  LNM_M_TABLE'
14
 
    if (l_attributes & LNM_M_CONCEALED):
15
 
        print '  LNM_M_CONCEALED'
16
 
    if (l_attributes & LNM_M_TERMINAL):
17
 
        print '  LNM_M_TERMINAL'
18
 
    if (l_attributes & LNM_M_EXISTS):
19
 
        print '  LNM_M_EXISTS'
20
 
    if (l_attributes & LNM_M_SHAREABLE):
21
 
        print '  LNM_M_SHAREABLE'
22
 
    if (l_attributes & LNM_M_CREATE_IF):
23
 
        print '  LNM_M_CREATE_IF'
24
 

	
25
 
lst = [itemList(LNM__TABLE),
26
 
       itemList(LNM__STRING),
27
 
       itemList(LNM__ATTRIBUTES, dtype=il_unsignedLong),
28
 
       itemList(LNM__MAX_INDEX, dtype=il_unsignedLong),
29
 
       itemList(LNM__ACMODE, dtype=il_unsignedByte)]
30
 

	
31
 
s, dict = trnlnm(tabnam='LNM$JOB', lognam='SYS$LOGIN', itmlst=lst)
32
 

	
33
 
print 'Table:', dict[LNM__TABLE]
34
 
print 'Value:', dict[LNM__STRING]
35
 
print 'Acmode:', dict[LNM__ACMODE]
36
 
print 'Max index:', dict[LNM__MAX_INDEX]
37
 
print 'Attributes:'
38
 
show_attr(dict[LNM__ATTRIBUTES])
0 comments (0 inline, 0 general)