GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — turn off notifications w/ NOTIFY param · tmthyjames/SQLCell@f5bec0d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • sqlcell.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎sqlcell.py‎

Copy file name to clipboardExpand all lines: sqlcell.py
+30-22Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class __SQLCell_GLOBAL_VARS__(object):
5252
INITIAL_QUERY = True
5353
PATH = False
5454
RAW = False
55+
NOTIFY = True
5556

5657
logger = logging.getLogger()
5758
handler = logging.StreamHandler()
@@ -860,30 +861,37 @@ def _SQL(path, cell, __KERNEL_VARS__):
860861
+'Rows: %s | '
861862
+'DB: %s | Host: %s'
862863
)
863-
864-
if ($.notify){
865-
$.notify({},{
866-
delay: 5000,
867-
animate: {
868-
enter: 'animated fadeInRight',
869-
exit: 'animated fadeOutRight'
870-
},
871-
allow_dismiss: true,
872-
mouse_over: "pause",
873-
template: '<div data-notify="container" class="col-xs-11 col-sm-3 alert alert-info" role="alert">' +
874-
'<button type="button" aria-hidden="true" class="close" data-notify="dismiss">x</button>' +
875-
'<div style="cursor:pointer;" data-notify="container" onclick="document.getElementById(`table%s`).scrollIntoView();">' +
876-
'<span data-notify="title"><strong>Query Finished</strong></span>' +
877-
`</br><span data-notify="message"><pre style=\"max-height:150px;overflow-y:scroll;\">%s</pre>To Execute: %s | Rows: %s | DB: %s | Host: %s</span>` +
878-
'</div>' +
879-
'</div>'
880-
});
881-
} else {
882-
console.log('$.notify is not a function. trouble loading bootstrap-notify.')
883-
}
884-
""" % (str(round(t1, 3)), len(df.index), engine.url.database, engine.url.host, unique_id, cell, str(round(t1, 3)), len(df.index), engine.url.database, engine.url.host)
864+
""" % (str(round(t1, 3)), len(df.index), engine.url.database, engine.url.host)
885865
)
886866
)
867+
868+
if __SQLCell_GLOBAL_VARS__.NOTIFY:
869+
display(
870+
Javascript(
871+
"""
872+
if ($.notify){
873+
$.notify({},{
874+
delay: 5000,
875+
animate: {
876+
enter: 'animated fadeInRight',
877+
exit: 'animated fadeOutRight'
878+
},
879+
allow_dismiss: true,
880+
mouse_over: "pause",
881+
template: '<div data-notify="container" class="col-xs-11 col-sm-3 alert alert-info" role="alert">' +
882+
'<button type="button" aria-hidden="true" class="close" data-notify="dismiss">x</button>' +
883+
'<div style="cursor:pointer;" data-notify="container" onclick="document.getElementById(`table%s`).scrollIntoView();">' +
884+
'<span data-notify="title"><strong>Query Finished</strong></span>' +
885+
`</br><span data-notify="message"><pre style=\"max-height:150px;overflow-y:scroll;\">%s</pre>To Execute: %s | Rows: %s | DB: %s | Host: %s</span>` +
886+
'</div>' +
887+
'</div>'
888+
});
889+
} else {
890+
console.log('$.notify is not a function. trouble loading bootstrap-notify.')
891+
}
892+
""" % (unique_id, cell, str(round(t1, 3)), len(df.index), engine.url.database, engine.url.host)
893+
)
894+
)
887895

888896
table_name = re.search('from\s*([a-z_][a-z\-_0-9]{,})', cell, re.IGNORECASE)
889897
table_name = None if not table_name else table_name.group(1).strip()

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.