forked from ksdme/org-status
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to export list of org repo
Add option to export list of org repos into different formats. Closes ksdme#6
- Loading branch information
Showing
4 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class OrgListEncoder: | ||
NAME = None | ||
|
||
@classmethod | ||
def convert_org_list_to_format(cls, repos): | ||
raise NotImplementedError() | ||
|
||
|
||
def get_all_supported_exporters(): | ||
from org_status.encoders.gitman import GitManEncoder | ||
|
||
return ( | ||
GitManEncoder, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import yaml | ||
from furl import furl | ||
|
||
from org_status.encoders import OrgListEncoder | ||
|
||
|
||
class GitManEncoder(OrgListEncoder): | ||
NAME = 'gitman' | ||
|
||
@classmethod | ||
def convert_org_list_to_format(cls, repos): | ||
repo_data = [] | ||
|
||
for repo in repos: | ||
name = furl(repo.repo_url).path.segments[1] | ||
repo_data.append({'name': name, | ||
'repo': repo.repo_url, | ||
'rev': 'master'}) | ||
|
||
return yaml.dump(repo_data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
git+https://gitlab.com/gitmate/open-source/IGitt.git#egg=IGitt | ||
requests | ||
termcolor | ||
furl | ||
pyyaml |