File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 88
99
1010# Supported platforms
11- PLATFORMS = (
11+ PLATFORMS = [
1212 # name -> Platform object
1313 ('github' , GitHubPlatform ()),
1414 ('bitbucket' , BitbucketPlatform ()),
1818
1919 # Match url
2020 ('base' , BasePlatform ()),
21- )
22-
23- PLATFORMS_MAP = dict (PLATFORMS )
21+ ]
Original file line number Diff line number Diff line change 11# Imports
2- from .platforms import PLATFORMS , PLATFORMS_MAP
2+ from .platforms import PLATFORMS
33
44
55# Possible values to extract from a Git Url
@@ -17,6 +17,12 @@ def __init__(self, parsed_info):
1717 for k , v in parsed_info .items ():
1818 setattr (self , k , v )
1919
20+ for name , platform in PLATFORMS :
21+ if name == self .platform :
22+ self ._platform_obj = platform
23+
24+ break
25+
2026 def _valid_attrs (self ):
2127 return all ([
2228 getattr (self , attr , None )
@@ -29,10 +35,6 @@ def valid(self):
2935 self ._valid_attrs (),
3036 ])
3137
32- @property
33- def _platform_obj (self ):
34- return PLATFORMS_MAP [self .platform ]
35-
3638 ##
3739 # Alias properties
3840 ##
You can’t perform that action at this time.
0 commit comments