Skip to content

Commit

Permalink
update url to get path from colab.
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Jan 28, 2024
1 parent 82111d0 commit 3020081
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pycse/colab.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import subprocess
import tempfile
from urllib.parse import urlparse
from socket import gethostname, gethostbyname

from IPython import display
from IPython.core.magic import register_line_magic
Expand Down Expand Up @@ -79,13 +80,11 @@ def aptinstall(apt_pkg):
# Exporting functions
##################################################################


def current_notebook():
"""Return current notebook name and file id.
from kora.drive.
"""
d = requests.get("http://172.28.0.2:9000/api/sessions").json()[0]
ip = gethostbyname(gethostname())
d = requests.get(f"{ip}:9000/api/sessions").json()[0]
fid = d["path"].split("=")[1]
fname = d["name"]
return fname, fid
Expand Down

0 comments on commit 3020081

Please sign in to comment.