Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default extension_name and validation #175

Merged
merged 1 commit into from
Jan 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions jupyter_server/extension/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ class method. This method can be set as a entry_point in
help="Name of extension."
)

@default('extension_name')
def _extension_name_default(self):
try:
return self.name
Expand All @@ -163,8 +164,8 @@ def _extension_name_default(self):
INVALID_EXTENSION_NAME_CHARS = [' ', '.', '+', '/']

@validate('extension_name')
def _validate_extension_name(self, value):
#value = self.extension_name
def _validate_extension_name(self, proposal):
value = proposal['value']
if isinstance(value, str):
# Validate that extension_name doesn't contain any invalid characters.
for c in ExtensionApp.INVALID_EXTENSION_NAME_CHARS:
Expand Down