Skip to content

Commit

Permalink
Disable @mayakr cards instead of remove
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Feb 10, 2019
1 parent cc06619 commit cbc09d6
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
44 changes: 44 additions & 0 deletions customjson/cards/maykar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
"""Generate json form maykar."""
from customjson.defaults import REUSE, VISIT


def get_data(github, selected_repos):
"""Generate json form maykar."""
org = 'maykar'
data = {}
repos = []
all_repos = ['compact-custom-header']
if selected_repos:
for repo in selected_repos:
if repo in all_repos:
repos.append(repo)
else:
repos = all_repos
for repo in repos:
try:
repo = github.get_repo(org + '/' + repo)
name = repo.name
print("Generating json for:", "{}/{}".format(org, name))

release = list(repo.get_releases())[0]

updated_at = repo.updated_at.isoformat().split('T')[0]

version = release.tag_name

remote_location = REUSE.format(org, name, name)
remote_location = remote_location + '.js'

visit_repo = VISIT.format(org, name)

changelog = release.html_url

data[name] = {}
data[name]['updated_at'] = updated_at
data[name]['version'] = version
data[name]['remote_location'] = remote_location
data[name]['visit_repo'] = visit_repo
data[name]['changelog'] = changelog
except Exception: # pylint: disable=W0703
pass
return data
5 changes: 5 additions & 0 deletions customjson/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def card(self):
from customjson.cards.org import get_data as org
from customjson.cards.ciotlosm import get_data as ciotlosm
from customjson.cards.isabellaalstrom import get_isabellaalstrom
#from customjson.cards.maykar import get_data as maykar
from customjson.cards.thomasloven import get_data as thomasloven

update_pending = self.customjson_update_pending()
Expand All @@ -163,6 +164,10 @@ def card(self):
for card in cards:
data[card] = cards[card]

#cards = maykar(self.github, self.repo)
#for card in cards:
# data[card] = cards[card]

cards = thomasloven(self.github, self.repo)
for card in cards:
data[card] = cards[card]
Expand Down
2 changes: 1 addition & 1 deletion customjson/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Version."""
MAJOR = 2
MINOR = 4
PATCH = 0
PATCH = 1
FORMAT = "{}.{}.{}"
__version__ = FORMAT.format(str(MAJOR), str(MINOR), str(PATCH))

0 comments on commit cbc09d6

Please sign in to comment.