Skip to content

Commit c6b4ac1

Browse files
committed
add backend functionality for including drive in listing
1 parent 5257f5d commit c6b4ac1

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

jupyter_drives/handlers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ async def post(self):
5656
result = self._manager.set_listing_limit(**body)
5757
if 'exclude_drive_name' in body:
5858
result = self._manager.exclude_drive(**body)
59+
if 'include_drive_name' in body:
60+
result = self._manager.include_drive(**body)
5961
self.finish(result)
6062

6163
class ListJupyterDrivesHandler(JupyterDrivesAPIHandler):

jupyter_drives/manager.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,22 @@ def exclude_drive(self, exclude_drive_name):
188188

189189
return
190190

191+
def include_drive(self, include_drive_name):
192+
"""Include drive in listing.
193+
194+
Args:
195+
include_bucket_name: drive to include in listing
196+
"""
197+
try:
198+
self._excluded_drives.remove(include_drive_name);
199+
except Exception as e:
200+
raise tornado.web.HTTPError(
201+
status_code= httpx.codes.BAD_REQUEST,
202+
reason= f"The following error occured when excluding the drive: {e}"
203+
)
204+
205+
return
206+
191207
async def list_drives(self):
192208
"""Get list of available drives.
193209

0 commit comments

Comments
 (0)