Compare commits
No commits in common. "08c1c8c7c33cebb1aff297076e6e5bf4aeff493c" and "79321791ac06456c7af65902fa0d07a19b6aa6e6" have entirely different histories.
08c1c8c7c3
...
79321791ac
3 changed files with 2 additions and 24 deletions
|
@ -10,7 +10,6 @@ from core.services.WebServiceApiService import WebServiceApiService
|
|||
from pathlib import Path
|
||||
from typing import Optional
|
||||
import os
|
||||
import random
|
||||
import re
|
||||
import shutil
|
||||
import stat
|
||||
|
@ -35,21 +34,10 @@ class ApplicationController:
|
|||
from core.controllers.ProfileController import ProfileController
|
||||
|
||||
persistent_state_path = f'{profile.get_data_path()}/persistent-state'
|
||||
font_path = f'{profile.get_data_path()}/fonts'
|
||||
|
||||
if not os.path.isdir(persistent_state_path) or len(os.listdir(persistent_state_path)) == 0:
|
||||
shutil.copytree(f'{version.get_installation_path()}/resources/initial-state', persistent_state_path)
|
||||
|
||||
if (not os.path.isdir(font_path) or len(os.listdir(font_path)) == 0) and os.path.isdir('/usr/share/fonts/truetype'):
|
||||
|
||||
font_families = [file.name for file in Path('/usr/share/fonts/truetype').iterdir() if file.is_dir()]
|
||||
preferred_font_families = ['dejavu', 'droid', 'liberation', 'libreoffice', 'noto', 'ubuntu']
|
||||
|
||||
font_family_subset = ApplicationController.__select_random_subset(font_families, preferred_font_families, 12)
|
||||
|
||||
for font_family in font_family_subset:
|
||||
shutil.copytree(f'/usr/share/fonts/truetype/{font_family}', f'{font_path}/{font_family}')
|
||||
|
||||
display = ApplicationController.__find_unused_display()
|
||||
time_zone = profile.determine_timezone()
|
||||
|
||||
|
@ -122,16 +110,6 @@ class ApplicationController:
|
|||
else:
|
||||
return ':170'
|
||||
|
||||
@staticmethod
|
||||
def __select_random_subset(items: list, preferred_items: list, limit: int):
|
||||
|
||||
available_preferred_items = [item for item in preferred_items if item in items]
|
||||
selectable_items = [item for item in items if item not in preferred_items]
|
||||
|
||||
selected_items = random.sample(selectable_items, random.randint(0, min(limit, len(selectable_items))))
|
||||
|
||||
return selected_items + available_preferred_items
|
||||
|
||||
@staticmethod
|
||||
def __run_process(initialization_file_path, profile, display, session_state):
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ class ApplicationVersion(Model):
|
|||
return os.path.isdir(self.get_installation_path()) and len(os.listdir(self.get_installation_path())) > 0
|
||||
|
||||
def is_supported(self):
|
||||
return self.exists(self.application_code, self.version_number) and self.format_revision == 2
|
||||
return self.exists(self.application_code, self.version_number) and self.format_revision == 1
|
||||
|
||||
def get_installed_file_hash(self):
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[project]
|
||||
name = "sp-hydra-veil-core"
|
||||
version = "1.1.0"
|
||||
version = "1.0.0"
|
||||
authors = [
|
||||
{ name = "Simplified Privacy" },
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue