-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconstants.py
More file actions
39 lines (31 loc) · 984 Bytes
/
Copy pathconstants.py
File metadata and controls
39 lines (31 loc) · 984 Bytes
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
#!/usr/bin/python
import sys
sys.dont_write_bytecode = True
class MetaConst(type):
def __getattr__(cls, key):
return cls[key]
def __setattr__(cls, key, value):
raise TypeError
class Const(object):
__metaclass__ = MetaConst
def __getattr__(self, name):
return self[name]
def __setattr__(self, name, value):
raise TypeError
class MappingKey(Const):
Key = "key"
Type = "type"
DefaultValue = "default"
NonOptional = "nonoptional"
Attributes = "attributes"
Transformer = "transformer"
SubType = "subtype"
Groups = "groups"
ModelConfig = "model_config"
ModelImport = "import"
ModelBaseClass = "extends"
class Type(Const):
NativeTypes = ["String", "Double", "Float", "Int", "Bool"]
ArrayType = "Array"
DictionaryType = "Dictionary"
CollectionTypes = ["Array", "Dictionary"]