Initialize VLC getters and metrics, fix some bugs in infra logic, needs to be refactored later on

This commit is contained in:
Timothyxxx
2024-01-04 17:05:17 +08:00
parent 03e99a68fb
commit ab71ebb2ba
7 changed files with 101 additions and 32 deletions

View File

@@ -1,2 +1,3 @@
from .file import get_cloud_file, get_vm_file
from .misc import get_rule
from .vlc import get_vlc_playing_info

View File

@@ -3,6 +3,7 @@ from typing import Dict
import os
import requests
def get_cloud_file(env, config: Dict[str, str]) -> str:
"""
Config:
@@ -25,6 +26,7 @@ def get_cloud_file(env, config: Dict[str, str]) -> str:
return _path
def get_vm_file(env, config: Dict[str, str]) -> str:
"""
Config:
@@ -33,12 +35,9 @@ def get_vm_file(env, config: Dict[str, str]) -> str:
"""
_path = os.path.join(env.cache_dir, config["dest"])
if os.path.exists(_path):
return _path
file = env.controller.get_file(config["path"])
with open(_path, "wb") as f:
f.write(file)
return _path

View File

@@ -2,4 +2,5 @@ from .table import compare_table
from .table import check_sheet_list, check_xlsx_freeze, check_zoom
from .docs import find_default_font, contains_page_break, compare_docx_files, compare_docx_tables, compare_line_spacing, compare_insert_equation
from .docs import compare_font_names, compare_subscript_contains, has_page_numbers_in_footers
from .docs import is_first_line_centered, check_file_exists, compare_contains_image
from .docs import is_first_line_centered, check_file_exists, compare_contains_image
from .vlc import is_vlc_playing