Skip to content

Commit

Permalink
update examples with extension_name-->name
Browse files Browse the repository at this point in the history
  • Loading branch information
Zsailer committed Jun 1, 2020
1 parent dcad189 commit ff78266
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/simple/simple_ext1/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class SimpleApp1(ExtensionAppJinjaMixin, ExtensionApp):

# The name of the extension.
extension_name = "simple_ext1"
name = "simple_ext1"

# The url that your extension will serve its homepage.
extension_url = '/simple_ext1/default'
Expand Down
8 changes: 4 additions & 4 deletions examples/simple/simple_ext1/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
class DefaultHandler(ExtensionHandlerMixin, JupyterHandler):
def get(self):
# The name of the extension to which this handler is linked.
self.log.info("Extension Name in {} Default Handler: {}".format(self.extension_name, self.extension_name))
self.log.info("Extension Name in {} Default Handler: {}".format(self.name, self.name))
# A method for getting the url to static files (prefixed with /static/<extension_name>).
self.log.info("Static URL for / in simple_ext1 Default Handler:".format(self.static_url(path='/')))
self.write('<h1>Hello Simple 1 - I am the default...</h1>')
self.write('Config in {} Default Handler: {}'.format(self.extension_name, self.config))
self.write('Config in {} Default Handler: {}'.format(self.name, self.config))

class RedirectHandler(ExtensionHandlerMixin, JupyterHandler):
def get(self):
self.redirect("/static/{}/favicon.ico".format(self.extension_name))
self.redirect("/static/{}/favicon.ico".format(self.name))

class ParameterHandler(ExtensionHandlerMixin, JupyterHandler):
class ParameterHandler(ExtensionHandlerMixin, JupyterHandler):
def get(self, matched_part=None, *args, **kwargs):
var1 = self.get_argument('var1', default=None)
components = [x for x in self.request.path.split("/") if x]
Expand Down
2 changes: 1 addition & 1 deletion examples/simple/simple_ext11/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class SimpleApp11(SimpleApp1):
})

# The name of the extension.
extension_name = "simple_ext11"
name = "simple_ext11"

# Te url that your extension will serve its homepage.
extension_url = '/simple_ext11/default'
Expand Down
2 changes: 1 addition & 1 deletion examples/simple/simple_ext2/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class SimpleApp2(ExtensionAppJinjaMixin, ExtensionApp):

# The name of the extension.
extension_name = "simple_ext2"
name = "simple_ext2"

# Te url that your extension will serve its homepage.
extension_url = '/simple_ext2'
Expand Down

0 comments on commit ff78266

Please sign in to comment.