Skip to content

Commit

Permalink
Base code for codium support (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
Electrenator committed Mar 10, 2024
1 parent 4ebaca9 commit 112f96d
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion src/browsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_windows(this) -> list[int]:
list[int]: Returns a list where every entry is a window and the
associated value is the tab count
"""
return _Firefox().get_windows() if _Firefox().is_running() else []
return _Chromium().get_windows() if _Chromium().is_running() else []


class _BrowserBase(ABC):
Expand Down Expand Up @@ -141,3 +141,38 @@ def parse_session_file(this, file_path: str) -> BrowserData:
browser_data.add_window(len(window["tabs"]))

return browser_data

class _Chromium(_BrowserBase):
"""
Chromium specific browser data
"""

def __init__(this):
super().__init__()
this.possible_application_names = [
# Chromium GNU/Linux
"chromium",
]
this.possible_tab_locations = [
# Chromium GNU/Linux ???
"~/.config/chromium/Default/Sessions/",
]

def is_running(this) -> bool:
return super().is_running()

def get_windows(this) -> list:
return super().get_windows()

def parse_session_file(this, file_path: str) -> BrowserData:
raw_browser_data = ""
browser_data = BrowserData()

# Read and decode file data
print(file_path)
# with open(file_path, "rb") as file:
# pass

# Read and insert window data into BrowserData object

return browser_data

0 comments on commit 112f96d

Please sign in to comment.