Fixes https://github.com/plasma-umass/scalene/issues/797. (#798)
Автор
Emery Berger

Коммитер
GitHub
год назад 
Файлов изменено: 3
+7–11
b23894d
scalene/find_browser.py
+2–1
@@ -12,7 +12,8 @@ | ||
try: | ||
# Get the default browser object | ||
browser = webbrowser.get(browserClass) | ||
return browser.name if browser.name not in text_browsers else None | ||
browser_name = browser.name if browser.name else browser.__class__.__name__ | ||
return browser_name if browser_name not in text_browsers else None | ||
except AttributeError: | ||
# https://github.com/plasma-umass/scalene/issues/790 | ||
# https://github.com/python/cpython/issues/105545 |
scalene/launchbrowser.py
+3–8
@@ -15,7 +15,7 @@ | ||
from jinja2 import Environment, FileSystemLoader | ||
from typing import Any, NewType | ||
import scalene.scalene_config | ||
import scalene_config | ||
def read_file_content(directory: str, subdirectory: str, filename: str) -> str: | ||
file_path = os.path.join(directory, subdirectory, filename) | ||
@@ -35,16 +35,12 @@ | ||
# Create a command with the required flags | ||
chrome_cmd = f'{chrome_path} %s --disable-web-security --user-data-dir="{temp_dir}"' | ||
# print(chrome_cmd) | ||
# Register the new browser type | ||
webbrowser.register('chrome_with_flags', None, | ||
webbrowser.Chrome(chrome_cmd), preferred=True) | ||
# Open a URL using the new browser type | ||
# url = 'https://cnn.com' # Replace with your desired URL | ||
webbrowser.get(chrome_cmd).open(url) | ||
# webbrowser.get('chrome_with_flags').open(url) | ||
HOST = 'localhost' | ||
@@ -133,8 +129,8 @@ | ||
prism_js=file_contents['prism_js_text'], | ||
tablesort_js=file_contents['tablesort_js_text'], | ||
tablesort_number_js=file_contents['tablesort_number_js_text'], | ||
scalene_version=scalene.scalene_config.scalene_version, | ||
scalene_date=scalene.scalene_config.scalene_date, | ||
scalene_version=scalene_config.scalene_version, | ||
scalene_date=scalene_config.scalene_date, | ||
) | ||
# Write the rendered content to the specified output file. | ||
@@ -170,7 +166,6 @@ | ||
if __name__ == '__main__': | ||
import sys | ||
print(sys.argv) | ||
if len(sys.argv) > 2: | ||
filename = sys.argv[1] | ||
port = int(sys.argv[2]) |
scalene/scalene_config.py
+2–2
@@ -1,7 +1,7 @@ | ||
"""Current version of Scalene; reported by --version.""" | ||
scalene_version = "1.5.37" | ||
scalene_date = "2024.03.10" | ||
scalene_version = "1.5.38" | ||
scalene_date = "2024.03.24" | ||
# Port to use for Scalene UI | ||
SCALENE_PORT = 11235 |
GPG верификация
Статус: Неверифицирован
Причина: Не найден публичный ключ
ID ключа: b5690eeebb952194
Cherry-pick
Команда cherry-pick позволяет выбрать отдельные коммиты из одной ветки и применить их к другой.