Skip to content

Commit

Permalink
more projects
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Oct 12, 2024
1 parent 7451a4d commit ca4af0c
Showing 1 changed file with 29 additions and 31 deletions.
60 changes: 29 additions & 31 deletions src/textual/demo2/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,14 @@ class ProjectInfo:
"Posting",
"Darren Burns",
"https://posting.sh/",
"""A powerful HTTP client that lives in your terminal.
Posting is an HTTP client, not unlike Postman and Insomnia. As a TUI application, it can be used over SSH and enables efficient keyboard-centric workflows. """,
"""Posting is an HTTP client, not unlike Postman and Insomnia. As a TUI application, it can be used over SSH and enables efficient keyboard-centric workflows. """,
"4.7k",
),
ProjectInfo(
"Memray",
"Bloomberg",
"https://github.com/bloomberg/memray",
"""Memray is a memory profiler for Python. It can track memory allocations in Python code, in native extension modules, and in the Python interpreter itself. It can generate several different types of reports to help you analyze the captured memory usage data.""",
"""Memray is a memory profiler for Python. It can track memory allocations in Python code, in native extension modules, and in the Python interpreter itself.""",
"13.2k",
),
ProjectInfo(
Expand All @@ -52,8 +50,7 @@ class ProjectInfo:
"Harlequin",
"Ted Conbeer",
"https://harlequin.sh/",
"""Portable, powerful, colorful.
An easy, fast, and beautiful database client for the terminal.""",
"""Portable, powerful, colorful. An easy, fast, and beautiful database client for the terminal.""",
"3.7k",
),
ProjectInfo(
Expand All @@ -68,9 +65,7 @@ class ProjectInfo:
"Trogon",
"Textualize",
"https://github.com/Textualize/trogon",
"""Auto-generate friendly terminal user interfaces for command line apps.
Trogon works with the popular Click library for Python, but will support other libraries and languages in the future.""",
"Auto-generate friendly terminal user interfaces for command line apps.",
"2.5k",
),
ProjectInfo(
Expand All @@ -84,18 +79,14 @@ class ProjectInfo:
"RecoverPy",
"Pablo Lecolinet",
"https://github.com/PabloLec/RecoverPy",
"""RecoverPy is a powerful tool that leverages your system capabilities to recover lost files.
Unlike others, you can not only recover deleted files but also overwritten data.""",
"""RecoverPy is a powerful tool that leverages your system capabilities to recover lost files.""",
"1.3k",
),
ProjectInfo(
"Frogmouth",
"Dave Pearson",
"https://github.com/Textualize/frogmouth",
"""Frogmouth is a Markdown viewer / browser for your terminal, built with Textual.
Frogmouth can open *.md files locally or via a URL. There is a familiar browser-like navigation stack, history, bookmarks, and table of contents.""",
"""Frogmouth is a Markdown viewer / browser for your terminal, built with Textual.""",
"2.5k",
),
ProjectInfo(
Expand All @@ -105,6 +96,20 @@ class ProjectInfo:
"The text-based terminal client for Ollama.",
"1k",
),
ProjectInfo(
"logmerger",
"Paul McGuire",
"https://github.com/ptmcg/logmerger",
"logmerger is a TUI for viewing a merged display of multiple log files, merged by timestamp.",
"162",
),
ProjectInfo(
"doit",
"Murli Tawari",
"https://github.com/kraanzu/dooit",
"A todo manager that you didn't ask for, but needed!",
"2.1k",
),
]


Expand Down Expand Up @@ -138,7 +143,6 @@ class Project(Vertical, can_focus=True):
border: tall transparent;
opacity: 0.8;
box-sizing: border-box;
&:focus-within {
border: tall $accent;
background: $primary 40%;
Expand Down Expand Up @@ -176,12 +180,13 @@ def __init__(self, project_info: ProjectInfo) -> None:
super().__init__()

def compose(self) -> ComposeResult:
info = self.project_info
with Horizontal(classes="header"):
yield Label(self.project_info.title, id="title")
yield Label(f"★ {self.project_info.stars}", classes="stars")
yield Label(self.project_info.author, id="author")
yield Link(self.project_info.url)
yield Static(self.project_info.description, classes="description")
yield Label(info.title, id="title")
yield Label(f"★ {info.stars}", classes="stars")
yield Label(info.author, id="author")
yield Link(info.url)
yield Static(info.description, classes="description")

@on(events.Enter)
@on(events.Leave)
Expand All @@ -195,24 +200,17 @@ def action_open_repository(self) -> None:

class ProjectsScreen(PageScreen):
DEFAULT_CSS = """
ProjectsScreen {
# margin: 1;
ProjectsScreen {
Grid {
margin: 1 2;
padding: 1 2;
background: $boost;
width: 1fr;
height: auto;
# grid-size: 2;
height: auto;
grid-gutter: 1 1;
grid-rows: auto;
hatch: right $accent 80%;
keyline:heavy $secondary;
}
Placeholder {
height: auto;
keyline:heavy $secondary;
}
}
"""
Expand Down

0 comments on commit ca4af0c

Please sign in to comment.