ViewMatrixPro 0.0.2__tar.gz → 0.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {viewmatrixpro-0.0.2/src/ViewMatrixPro.egg-info → viewmatrixpro-0.0.3}/PKG-INFO +1 -1
- {viewmatrixpro-0.0.2 → viewmatrixpro-0.0.3}/setup.py +1 -1
- viewmatrixpro-0.0.3/src/ViewMatrixPro/site.py +28 -0
- {viewmatrixpro-0.0.2 → viewmatrixpro-0.0.3/src/ViewMatrixPro.egg-info}/PKG-INFO +1 -1
- {viewmatrixpro-0.0.2 → viewmatrixpro-0.0.3}/src/ViewMatrixPro.egg-info/SOURCES.txt +1 -0
- {viewmatrixpro-0.0.2 → viewmatrixpro-0.0.3}/LICENSE +0 -0
- {viewmatrixpro-0.0.2 → viewmatrixpro-0.0.3}/README.md +0 -0
- {viewmatrixpro-0.0.2 → viewmatrixpro-0.0.3}/pyproject.toml +0 -0
- {viewmatrixpro-0.0.2 → viewmatrixpro-0.0.3}/setup.cfg +0 -0
- {viewmatrixpro-0.0.2 → viewmatrixpro-0.0.3}/src/ViewMatrixPro/__init__.py +0 -0
- {viewmatrixpro-0.0.2 → viewmatrixpro-0.0.3}/src/ViewMatrixPro/custom_exception.py +0 -0
- {viewmatrixpro-0.0.2 → viewmatrixpro-0.0.3}/src/ViewMatrixPro/logger.py +0 -0
- {viewmatrixpro-0.0.2 → viewmatrixpro-0.0.3}/src/ViewMatrixPro/youtube.py +0 -0
- {viewmatrixpro-0.0.2 → viewmatrixpro-0.0.3}/src/ViewMatrixPro.egg-info/dependency_links.txt +0 -0
- {viewmatrixpro-0.0.2 → viewmatrixpro-0.0.3}/src/ViewMatrixPro.egg-info/requires.txt +0 -0
- {viewmatrixpro-0.0.2 → viewmatrixpro-0.0.3}/src/ViewMatrixPro.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from IPython import display
|
|
2
|
+
import urllib.request
|
|
3
|
+
from ViewMatrixPro.custom_exception import InvalidURLException
|
|
4
|
+
from ViewMatrixPro.logger import logger
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def is_valid(URL: str) -> bool:
|
|
9
|
+
try:
|
|
10
|
+
response_status = urllib.request.urlopen(URL).getcode()
|
|
11
|
+
assert response_status == 200
|
|
12
|
+
logger.debug(f"response_status: {response_status}")
|
|
13
|
+
return True
|
|
14
|
+
except Exception as e:
|
|
15
|
+
logger.exception(e)
|
|
16
|
+
return False
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def render_site(URL: str, width: str = "100%", height: str = "600") -> str:
|
|
20
|
+
try:
|
|
21
|
+
if is_valid(URL):
|
|
22
|
+
response = display.IFrame(src=URL, width=width, height=height)
|
|
23
|
+
display.display(response)
|
|
24
|
+
return "success"
|
|
25
|
+
else:
|
|
26
|
+
raise InvalidURLException
|
|
27
|
+
except Exception as e:
|
|
28
|
+
raise e
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|