Skip to content

Commit

Permalink
Add support for @iantrich crazy cards
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Mar 16, 2019
1 parent 7e395ca commit b7c7636
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions customjson/cards/org.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Generate json form custom-cards org."""
import requests
from customjson.defaults import REUSE, REUSE_TAG, VISIT, BLACKLIST


Expand Down Expand Up @@ -42,7 +43,16 @@ def get_data(github, selected_repos):
org, name, version, name)
else:
remote_location = REUSE.format(org, name, name)

remote_location = remote_location + '.js'
testfile = requests.get(remote_location)

if testfile.status_code != 200:
remote_location = remote_location.split(name + '.js')[0]
remote_location = remote_location + 'dist/' + name + '.js'
testfile = requests.get(remote_location)
if testfile.status_code != 200:
continue

visit_repo = VISIT.format(org, name)

Expand Down
2 changes: 1 addition & 1 deletion customjson/defaults.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Default values."""
REUSE = 'https://raw.githubusercontent.com/{}/{}/master/{}'
REUSE_TAG = 'https://raw.githubusercontent.com/{}/{}/{}/{}'
BLACKLIST = ['information', 'sun']
BLACKLIST = ['information', 'sun', 'boilerplate-card', 'blueprint']
DOMAINS = ['air_quality',
'binary_sensor',
'camera',
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 = 7
MINOR = 8
PATCH = 0
FORMAT = "{}.{}.{}"
__version__ = FORMAT.format(str(MAJOR), str(MINOR), str(PATCH))

1 comment on commit b7c7636

@iantrich
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wait. I’ll figure out how to break this again

Please sign in to comment.