修訂 | 42deabb546408f94821b4453ff6ef07b4bdc2067 (tree) |
---|---|
時間 | 2022-01-23 07:25:56 |
作者 | Sergey Gusarov <laborer2008@gmai...> |
Commiter | Sergey Gusarov |
AccountName: Added org()
@@ -26,6 +26,8 @@ | ||
26 | 26 | |
27 | 27 | COMMON_NAME = 'ALL' |
28 | 28 | |
29 | + SEPARATOR = ' ' | |
30 | + | |
29 | 31 | def __new__(cls, content): |
30 | 32 | logger = log.getLogger() |
31 | 33 |
@@ -64,7 +66,7 @@ | ||
64 | 66 | return super().__new__(cls, content) |
65 | 67 | |
66 | 68 | def isCommon(self): |
67 | - nameSplitted = self.split(' ') | |
69 | + nameSplitted = self.split(AccountName.SEPARATOR) | |
68 | 70 | if len(nameSplitted) == 2: |
69 | 71 | if nameSplitted[1] == AccountName.COMMON_NAME: |
70 | 72 | common = True |
@@ -74,3 +76,12 @@ | ||
74 | 76 | common = False |
75 | 77 | |
76 | 78 | return common |
79 | + | |
80 | + def org(self): | |
81 | + nameSplitted = self.split(AccountName.SEPARATOR) | |
82 | + if len(nameSplitted) >= 1: | |
83 | + organization = nameSplitted[0] | |
84 | + else: | |
85 | + organization = '' | |
86 | + | |
87 | + return organization |