MCPcopy Index your code
hub / github.com/Futsch1/image-sieve

github.com/Futsch1/image-sieve @v0.6.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.6.0 ↗ · + Follow
260 symbols 581 edges 29 files 140 documented · 54%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

import typing import textwrap from itertools import chain

def get_chapter(heading: str, level: int, data: typing.List[str]) -> typing.List[str]: """ Get the chapter from the data. """ start = data.index('#' * level + ' ' + heading + '\n') for end, line in enumerate(data[start + 1:]): if line.startswith('#' * (level)) or line.startswith('#' * (level - 1)): return data[start + 1:start+end] return data[start + 1:]

def process_line(s: str) -> typing.List[str]: """ Process a line. """ s = s.replace('"', '\"') if len(s) == 1: return [""] else: return textwrap.wrap(s, width=180)

with open("README.md", "r") as f: lines = f.readlines()

chapters = ["📷 📹 Images", '📅 Events', '💾 Sieve', '⚙ Settings'] chapter_help = {} for chapter in chapters: chapter_lines = get_chapter(chapter, 3, lines) chapter_content = list(chain(*[process_line(line) for line in filter( lambda x: not x.startswith('!['), chapter_lines)])) chapter_help[chapter] = '\n'.join(chapter_content)

with open('ui/help.slint', 'r') as f: lines = f.readlines()

for chapter in chapter_help: for number, line in enumerate(lines): if chapter in line: print(f'Found {chapter} at line {number}') for text_number, text_line in enumerate(lines[number + 1:]): if 'text:' in text_line: print(f'Inserting text at line {number + text_number + 1}') lines[number + text_number + 1] = f' Text {{ text: "{chapter_help[chapter]}";\n' break break

with open('ui/help.slint', 'w') as f: f.writelines(lines)

Extension points exported contracts — how you extend this code

PropertyResolver (Interface)
Trait to get a timestamp and an optional orientation from a file [6 implementers]
src/item_sort_list/item_traits.rs
JsonPersistence (Interface)
Trait to load and save data from/to a file [2 implementers]
src/persistence/json.rs
SieveIO (Interface)
Trait to encapsulate sieve file IO operations [2 implementers]
src/item_sort_list/sieve.rs

Core symbols most depended-on inside this repo

clear
called by 14
src/misc/lru_map.rs
restrict_size
called by 14
src/misc/resize.rs
populate_list_model
called by 10
src/controller/items_controller.rs
is_image
called by 7
src/item_sort_list/file_item.rs
check_and_add
called by 7
src/item_sort_list/item_list.rs
parse_date
called by 7
src/item_sort_list/event.rs
get_model
called by 7
src/controller/events_controller.rs
put
called by 7
src/misc/lru_map.rs

Shape

Method 118
Function 111
Class 19
Enum 9
Interface 3

Languages

Rust99%
Python1%

Modules by API surface

src/item_sort_list/file_item.rs42 symbols
src/controller/items_controller.rs24 symbols
src/item_sort_list/item_list.rs23 symbols
src/item_sort_list/event.rs18 symbols
src/item_sort_list/sieve.rs17 symbols
src/item_sort_list/resolvers.rs15 symbols
src/synchronize.rs14 symbols
src/misc/images.rs12 symbols
src/misc/image_cache.rs12 symbols
src/controller/events_controller.rs12 symbols
src/persistence/json.rs11 symbols
src/persistence/settings.rs9 symbols

For agents

$ claude mcp add image-sieve \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact