-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv_reader.py
More file actions
115 lines (92 loc) · 6.99 KB
/
env_reader.py
File metadata and controls
115 lines (92 loc) · 6.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
↓↓...........................................................................↓↓
↓↓..........................↓↓↓↓↓↓↓↓↓↓↓↓↓....................................↓↓
↓↓.......................↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓.................................↓↓
↓↓.....................↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓...............................↓↓
↓↓....................↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓..............................↓↓
↓↓...................↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓.↓↓...............................↓↓
↓↓...................↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓...↓↓..............................↓↓
↓↓...................↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓.↓↓...↓↓↓.............................↓↓
↓↓...................↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓..............................↓↓
↓↓....................↓↓↓↓↓↓↓↓↓↓↓↓↓.....↓↓↓↓↓↓↓↓↓............................↓↓
↓↓......................↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓..↓↓↓↓↓↓↓............................↓↓
↓↓...................................↓↓↓.....................................↓↓
↓↓.................↓↓................↓↓↓↓ ↓↓↓↓↓↓↓........↓...................↓↓
↓↓...............↓↓↓↓↓↓..............↓↓↓↓↓↓↓↓↓↓↓↓↓...↓↓↓↓↓↓..................↓↓
↓↓............↓↓↓↓..↓↓↓↓↓.........................↓↓↓↓↓↓↓↓↓..................↓↓
↓↓............↓↓↓↓...↓↓↓↓↓↓↓....................↓↓↓↓↓↓.↓↓.↓↓.................↓↓
↓↓...............↓↓↓↓↓↓↓↓↓↓↓↓↓↓............↓↓↓↓↓↓↓↓..........................↓↓
↓↓.........................↓↓↓↓↓↓↓↓↓...↓↓↓↓↓↓↓...............................↓↓
↓↓..............................↓↓↓↓↓↓↓↓↓↓...................................↓↓
↓↓..........................↓↓↓↓↓....↓↓↓↓↓↓↓↓↓...............................↓↓
↓↓............↓↓.↓↓↓↓↓↓↓↓↓↓↓↓↓............↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓..................↓↓
↓↓............↓↓.↓↓..↓↓↓↓.....................↓↓↓↓↓↓↓↓↓↓↓↓↓↓.................↓↓
↓↓..............↓↓↓↓↓↓............................↓↓.↓↓↓↓↓↓↓.................↓↓
↓↓.................. ......................↓↓
↓↓.................. ↑↑↑ ↑↑↑ ↑↑↑↑↑↑↑ ↑↑↑↑↑↑↑ .......................↓↓
↓↓.................. ↑↑↑ ↑↑↑ ↑↑↑ ↑↑↑↑ ↑↑↑ ↑↑↑↑.....................↓↓
↓↓.................. ↑↑↨ ↑↑↑ ↑↑↨ ↨↑↑ ↑↑↨ ↨↑↑......................↓↓
↓↓.................. ↨↑↨ ↑↨↑ ↨↑↨ ↨↑↨ ↨↑↨ ↨↑↨......................↓↓
↓↓.................. ↑↨↑ ↨↑↨ ↨↨↑↨↑↨↨↑↑↨ ↨↨↑↨↑↨↨↑↑↨.....................↓↓
↓↓.................. ↨↑↨ ↨↨↨ ↨↨↨ ↨↨↨ ↨↨↨ ↨↨↨....................↓↓
↓↓.................. :↨: ↨↨: ↨↨: :↨↨ ↨↨: :::....................↓↓
↓↓................... ::↨↨:↨ :↨: :↨: :↨: :::....................↓↓
↓↓.................... :::: ::: ::: ::: :::....................↓↓
↓↓...................... : : : ::::::: ....................↓↓
↓↓...........................................................................↓↓
↓↓←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←↓↓
↓↓→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→↓↓
↓↓ env_reader.py Created by Durodola Opemipo 2019 ↓↓
↓↓ Personal Email : <opemipodurodola@gmail.com> ↓↓
↓↓ Telephone Number: +2348182104309 ↓↓
↓↓→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→↓↓
↓↓←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←↓↓
"""
import random
import string
def randomString(stringLength):
"""
Generate a random string of fixed length
:param stringLength:
:return:
"""
return ''.join(random.choice(string.digits + string.ascii_lowercase + string.digits) for i in range(stringLength))
def generate_id():
"""
Generate Unique Identifier
:return id:
"""
_id = randomString(8) + "-" + randomString(4) + "-" + randomString(4) + "-" + randomString(4) + "-" + randomString(12)
return _id
def initialize_octpus_varible(key, value):
"""
Initialize Octopus variable
:param key:
:param value:
:return: variable
"""
variable = {
'Id' : generate_id(),
'Name': key,
'Value': value,
'Description': None,
'Scope': {},
'IsEditable': True,
'Prompt': None,
'Type': 'String',
'IsSensitive': False
}
# print(variable)
return variable
def load_env_to_variable_set(vss):
"""
:param vss:
:return:
"""
return [initialize_octpus_varible(key, value) for key, value in vss.items()]
#
# print(initialize_octpus_varible("MONGODB", "examplw.dlab@dc.com"))