This repository has been archived by the owner on Mar 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
have some idea what can go wrong from this
- Loading branch information
1 parent
8d652a1
commit 69bcd08
Showing
73 changed files
with
698 additions
and
698 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
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
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 |
---|---|---|
|
@@ -48,7 +48,7 @@ form div { | |
list-style-type: disc; | ||
} | ||
|
||
#bucket-list { | ||
#data_set-list { | ||
list-style-type: none; | ||
margin-left: 0; | ||
} |
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
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
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
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,9 +1,9 @@ | ||
from werkzeug.routing import BaseConverter, ValidationError | ||
from backdrop.core.validation import bucket_is_valid | ||
from backdrop.core.validation import data_set_is_valid | ||
|
||
|
||
class BucketConverter(BaseConverter): | ||
def to_python(self, value): | ||
if not bucket_is_valid(value): | ||
if not data_set_is_valid(value): | ||
raise ValidationError() | ||
return value |
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
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,25 +1,25 @@ | ||
from collections import namedtuple | ||
|
||
|
||
def _bucket_list_is_valid(buckets): | ||
if not isinstance(buckets, list): | ||
def _data_set_list_is_valid(data_sets): | ||
if not isinstance(data_sets, list): | ||
return False | ||
|
||
is_string = lambda value: isinstance(value, basestring) | ||
|
||
return all(map(is_string, buckets)) | ||
return all(map(is_string, data_sets)) | ||
|
||
|
||
_UserConfig = namedtuple( | ||
"_UserConfig", | ||
"email buckets") | ||
"email data_sets") | ||
|
||
|
||
class UserConfig(_UserConfig): | ||
def __new__(cls, email, buckets=None): | ||
if buckets is None: | ||
buckets = [] | ||
elif not _bucket_list_is_valid(buckets): | ||
raise ValueError("buckets must be a list of bucket names") | ||
def __new__(cls, email, data_sets=None): | ||
if data_sets is None: | ||
data_sets = [] | ||
elif not _data_set_list_is_valid(data_sets): | ||
raise ValueError("data_sets must be a list of data_set names") | ||
|
||
return super(UserConfig, cls).__new__(cls, email, buckets) | ||
return super(UserConfig, cls).__new__(cls, email, data_sets) |
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
Oops, something went wrong.