Skip to content

Commit 2077791

Browse files
committed
Updated logo, repo name, and finalized readme
1 parent 9b6f1f7 commit 2077791

33 files changed

+35
-18
lines changed

README.md

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<!-- PROJECT SUMMARY -->
66
<br />
77
<div align="center">
8-
<img src="https://github.com/Kieran-Lock/XtermGUI/blob/main/logo.png" alt="Logo">
8+
<img src="https://i.imgur.com/8nvN82u.png" alt="Logo">
99
<br />
1010
<p align="center">
1111
A lightweight, expressive GUI framework for compatible terminals
@@ -39,7 +39,7 @@ With zero external dependencies, and features including keyboard and mouse input
3939
<!-- GETTING STARTED -->
4040
## Getting Started
4141

42-
XtermGUI is available on [PyPI](https://pypi.org/), under the name `XtermGUI` To use it in your project, run:
42+
XtermGUI is available on [PyPI](https://pypi.org/project/XtermGUI/). To use it in your project, run:
4343

4444
```
4545
pip install XtermGUI
@@ -71,7 +71,7 @@ This framework has been tested using the default setup for [WSL 2](https://learn
7171

7272
Use the `console_inputs` context manager to prepare the terminal for use with XtermGUI. This will handle the cleanup automatically.
7373
```py
74-
from XtermGUI import console_inputs
74+
from xtermgui import console_inputs
7575

7676

7777
with console_inputs():
@@ -83,7 +83,7 @@ _Please note that there may sometimes be control sequence leakage when exiting y
8383

8484
Use the `read_console` function to read both keyboard and mouse input from the console. View the [API summary](#api-summary) or [documentation](https://github.com/Kieran-Lock/XtermGUI/blob/main/DOCUMENTATION.md) for the possible events you can receieve from this function.
8585
```py
86-
from XtermGUI import console_inputs, read_console
86+
from xtermgui import console_inputs, read_console
8787

8888

8989
with console_inputs():
@@ -93,7 +93,7 @@ with console_inputs():
9393

9494
Read repeated console input by placing this function in a loop. This can be useful for reading a stream of user inputs.
9595
```py
96-
from XtermGUI import console_inputs, read_console
96+
from xtermgui import console_inputs, read_console
9797

9898

9999
with console_inputs():
@@ -106,14 +106,14 @@ with console_inputs():
106106

107107
The `Text` class can be used to represent formatted text, which can be printed to the console. It provides all the same functionality as the built-in `str` string type, but can be used in conjunction with the `Style` and `Colour` classes to represent coloured and styled text.
108108
```py
109-
from XtermGUI import Colours, Styles, Text, Colour
109+
from xtermgui import Colours, Styles, Text, Colour, RGBs
110110

111111

112112
Colour.configure_default_background(RGBs.DEFAULT_BACKGROUND_WSL.value) # Test written in WSL, so the background is configured like so
113113

114114

115115
text = "This is styled text."
116-
text_colour = Colours.F_BLUE.blend(Colours.F_GREY.value, foreground_bias=0.5, foreground_gamma=2.2) # This blending just uses the default blending parameters
116+
text_colour = Colours.F_BLUE.value.blend(Colours.F_GREY.value, foreground_bias=0.5, foreground_gamma=2.2) # This blending just uses the default blending parameters
117117
text_background_colour = Colours.B_BLACK.value
118118
text_style = Styles.BOLD.value + Styles.UNDERLINED.value
119119

@@ -136,7 +136,7 @@ For more complex use cases, it is best to organise your application using the `G
136136

137137
You can create a simple GUI by inheriting from `GUI`.
138138
```py
139-
from XtermGUI import GUI
139+
from xtermgui import GUI
140140

141141

142142
class MyGUI(GUI):
@@ -146,7 +146,7 @@ class MyGUI(GUI):
146146

147147
You can use this GUI by using the `start` method as a context manager.
148148
```py
149-
from XtermGUI import GUI
149+
from xtermgui import GUI
150150

151151

152152
class MyGUI(GUI):
@@ -171,7 +171,7 @@ Receiving input events, via interactions, is an opt-in behaviour in XtermGUI. Wh
171171

172172
To use a `GUI` with this capability, pass `inputs=True` to the `start` method.
173173
```py
174-
from XtermGUI import GUI
174+
from xtermgui import GUI
175175

176176

177177
class MyGUI(GUI):
@@ -194,24 +194,24 @@ if __name__ == "__main__":
194194

195195
Receive keyboard events with the `KeyboardInteraction` decorator.
196196
```py
197-
from XtermGUI import GUI, KeyboardInteraction, Events, KeyboardEvent
197+
from xtermgui import GUI, KeyboardInteraction, Events, KeyboardEvent
198198

199199

200200
class MyGUI(GUI):
201201
def __init__(self) -> None:
202202
super().__init__()
203203

204204
@KeyboardInteraction(Events.SPACE.value)
205-
def clicked_space(self, event: KeyboardEvent) -> None:
206-
...
205+
def clicked_space(self, event: KeyboardEvent) -> None:
206+
...
207207
```
208208
The `clicked_space` method runs when space is pressed. Reference the API for other keyboard events you can receive.
209209

210210
#### Mouse Interactions
211211

212212
Mouse events can be dealt with similarly, with the `MouseInteraction` decorator.
213213
```py
214-
from XtermGUI import GUI, MouseInteraction, Events, MouseEvent, Region, Coordinate
214+
from xtermgui import GUI, MouseInteraction, Events, MouseEvent, Region, Coordinate
215215

216216

217217
INTERACTION_REGION = Region(Coordinate(0, 0), Coordinate(20, 0), Coordinate(20, 10), Coordinate(0, 10)) # An example region - a 20x10 rectangle, which forms a square in the terminal
@@ -231,7 +231,7 @@ Mouse interactions require an `Event`, and take a `Region` as an optional argume
231231

232232
The `GUI` class provides three key I/O methods - `print`, `erase`, and `clear` - each of which are show below.
233233
```py
234-
from XtermGUI import GUI, Coordinate
234+
from xtermgui import GUI, Coordinate
235235

236236

237237
class MyGUI(GUI):
@@ -258,7 +258,7 @@ if __name__ == "__main__":
258258

259259
To manage GUI layers in your application, use the `LayeredGUI` class. This will provide all of the same I/O methods as the simple `GUI` class, but manages layers automatically.
260260
```py
261-
from XtermGUI import Colour, RGBs, LayeredGUI, Coordinate
261+
from xtermgui import Colour, RGBs, LayeredGUI, Coordinate
262262

263263

264264
Colour.configure_default_background(RGBs.DEFAULT_BACKGROUND_WSL.value)
@@ -302,6 +302,10 @@ Details of the XtermGUI API are listed below for quick reference.
302302

303303
Input events can be received via the `GUI` API.
304304
```py
305+
from enum import Enum
306+
from xtermgui import Event, KeyboardEvent, MouseEvent
307+
308+
305309
class Events(Enum):
306310
SHIFT_BACKSPACE: Event = Event("SHIFT_BACKSPACE")
307311
TAB: Event = Event("TAB")
@@ -406,6 +410,10 @@ Events that do not appear in this enum (such as the letters of the alphabet) can
406410

407411
RGB colours represent only information about a specific colour.
408412
```py
413+
from enum import Enum
414+
from xtermgui import RGB
415+
416+
409417
class RGBs(Enum):
410418
DEFAULT_FOREGROUND = RGB(192, 192, 192)
411419
DEFAULT_BACKGROUND_PYCHARM = RGB(43, 43, 43)
@@ -429,6 +437,11 @@ class RGBs(Enum):
429437

430438
Text colours represent the colour of text printed to the console.
431439
```py
440+
from enum import Enum
441+
from xtermgui import Colour, RGBs
442+
443+
444+
432445
class Colours(Enum):
433446
F_BLACK: Colour = Colour(foreground=RGBs.BLACK.value)
434447
F_WHITE: Colour = Colour(foreground=RGBs.WHITE.value)
@@ -465,6 +478,10 @@ class Colours(Enum):
465478

466479
Text styles represent the style of text printed to the console.
467480
```py
481+
from enum import Enum
482+
from xtermgui import Style
483+
484+
468485
class Styles(Enum):
469486
NOT_STYLED: Style = Style()
470487
BOLD: Style = Style(bold=True)

logo.png

-9.94 KB
Loading

main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
from consolegui import Colour, RGBs, console_inputs, read_console
1+
from xtermgui import Colour, RGBs, console_inputs, read_console
22

33

44
if __name__ == "__main__":
55
Colour.configure_default_background(RGBs.DEFAULT_BACKGROUND_WSL.value)
66

7-
print("This program showcases the basic capabilities of ConsoleGUI. Exit with ctrl + c.\t\n")
7+
print("This program showcases the basic capabilities of XtermGUI. Exit with ctrl + c.\t\n")
88
with console_inputs():
99
while True:
1010
read = read_console()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)