File tree 2 files changed +9
-9
lines changed
2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 8
8
9
9
10
10
# Supported platforms
11
- PLATFORMS = (
11
+ PLATFORMS = [
12
12
# name -> Platform object
13
13
('github' , GitHubPlatform ()),
14
14
('bitbucket' , BitbucketPlatform ()),
18
18
19
19
# Match url
20
20
('base' , BasePlatform ()),
21
- )
22
-
23
- PLATFORMS_MAP = dict (PLATFORMS )
21
+ ]
Original file line number Diff line number Diff line change 1
1
# Imports
2
- from .platforms import PLATFORMS , PLATFORMS_MAP
2
+ from .platforms import PLATFORMS
3
3
4
4
5
5
# Possible values to extract from a Git Url
@@ -17,6 +17,12 @@ def __init__(self, parsed_info):
17
17
for k , v in parsed_info .items ():
18
18
setattr (self , k , v )
19
19
20
+ for name , platform in PLATFORMS :
21
+ if name == self .platform :
22
+ self ._platform_obj = platform
23
+
24
+ break
25
+
20
26
def _valid_attrs (self ):
21
27
return all ([
22
28
getattr (self , attr , None )
@@ -29,10 +35,6 @@ def valid(self):
29
35
self ._valid_attrs (),
30
36
])
31
37
32
- @property
33
- def _platform_obj (self ):
34
- return PLATFORMS_MAP [self .platform ]
35
-
36
38
##
37
39
# Alias properties
38
40
##
You can’t perform that action at this time.
0 commit comments