Commit d47fd13 1 parent f0038dc commit d47fd13 Copy full SHA for d47fd13
File tree 3 files changed +21
-29
lines changed
3 files changed +21
-29
lines changed Original file line number Diff line number Diff line change 6
6
import os
7
7
from time import sleep
8
8
9
- from pygeds import status , GEDSConfig
9
+ from pygeds import status , GEDS , GEDSConfig
10
10
11
11
METADATA_SERVER = os .environ .get ("GEDS_METADATASERVER" , "zac13:4381" )
12
12
Original file line number Diff line number Diff line change 6
6
import os
7
7
from time import sleep
8
8
9
- from pygeds import status , GEDS
9
+ from pygeds import status , GEDS , GEDSConfig
10
10
11
+ METADATA_SERVER = os .environ .get ("GEDS_METADATASERVER" , "zac13:4381" )
11
12
12
- def get_geds_instance ():
13
- METADATA_SERVER = os .environ .get ("GEDS_METADATASERVER" , "zac13:4381" )
14
- instance = GEDS (METADATA_SERVER )
15
- try :
16
- instance .start ()
17
- except status .StatusNotOk as e :
18
- print (e .status )
19
- exit (1 )
20
- return instance
21
-
22
-
23
- geds = get_geds_instance ()
13
+ instance = GEDS (GEDSConfig (METADATA_SERVER ))
14
+ try :
15
+ instance .start ()
16
+ except status .StatusNotOk as e :
17
+ print (e .status )
18
+ exit (1 )
24
19
25
20
message = "Hello World!"
26
- testfile = geds .create ("metadata" , "String" )
21
+ testfile = instance .create ("metadata" , "String" )
27
22
testfile .set_metadata ("Hello World" , True )
28
23
29
- testfile = geds .create ("metadata" , "ByteArray" )
24
+ testfile = instance .create ("metadata" , "ByteArray" )
30
25
message = bytearray (
31
26
[
32
27
0x54 ,
Original file line number Diff line number Diff line change 5
5
6
6
import os
7
7
8
- from pygeds import status , GEDS
8
+ from pygeds import status , GEDS , GEDSConfig
9
9
10
+ METADATA_SERVER = os .environ .get ("GEDS_METADATASERVER" , "zac13:4381" )
10
11
11
- def get_geds_instance ():
12
- METADATA_SERVER = os .environ .get ("GEDS_METADATASERVER" , "zac13:4381" )
13
- instance = GEDS (METADATA_SERVER )
14
- try :
15
- instance .start ()
16
- except status .StatusNotOk as e :
17
- print (e .status )
18
- exit (1 )
19
- return instance
12
+ instance = GEDS (GEDSConfig (METADATA_SERVER ))
13
+ try :
14
+ instance .start ()
15
+ except status .StatusNotOk as e :
16
+ print (e .status )
17
+ exit (1 )
20
18
21
19
22
20
message = "Hello World!"
23
- geds = get_geds_instance ()
24
- testfile = geds .open ("metadata" , "String" )
21
+ testfile = instance .open ("metadata" , "String" )
25
22
print ("Metadata: " + testfile .metadata )
26
23
assert testfile .metadata == "Hello World"
27
24
28
- testfile = geds .open ("metadata" , "ByteArray" )
25
+ testfile = instance .open ("metadata" , "ByteArray" )
29
26
message = bytearray (
30
27
[
31
28
0x54 ,
You can’t perform that action at this time.
0 commit comments