Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bunch of fix and improvements #32

Merged
merged 51 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
7bd6ad8
...
littlewhitecloud Jun 11, 2023
0a64503
Update README.md
littlewhitecloud Jun 11, 2023
75b1d20
Update README_CH.md
littlewhitecloud Jun 11, 2023
dc7d2b5
Update README_CH.md
littlewhitecloud Jun 11, 2023
f70a9f7
Update README.md
littlewhitecloud Jun 11, 2023
d5d4731
Small loop
Moosems Jun 12, 2023
2985bf0
oops
littlewhitecloud Jun 16, 2023
1f861f2
Eat my word, taste bad.
littlewhitecloud Jun 16, 2023
7c2e937
upload the screenshot
littlewhitecloud Jun 17, 2023
635afb6
Eat my word..... Taste nice!
littlewhitecloud Jun 17, 2023
4af0835
cut off some tr sp
littlewhitecloud Jun 17, 2023
632f568
sorry
littlewhitecloud Jun 17, 2023
6ae809f
Ate my word
littlewhitecloud Jun 17, 2023
48651b1
Delete littlewhitecloudversion.py
littlewhitecloud Jun 17, 2023
833c53e
Update tkterm.py
littlewhitecloud Jun 17, 2023
d3cc659
Update
littlewhitecloud Jun 19, 2023
cd28cbb
More easier to determine the platform with out complex if else
littlewhitecloud Jun 19, 2023
3231568
not default
littlewhitecloud Jun 19, 2023
cc71aee
autohide will no longer default
littlewhitecloud Jun 19, 2023
7a63399
update document
littlewhitecloud Jun 19, 2023
0e37a45
rename hi to historyindex
littlewhitecloud Jun 19, 2023
5279ae9
com img
littlewhitecloud Jun 19, 2023
4dbcd8c
wrong path s
littlewhitecloud Jun 19, 2023
421217b
s w p
littlewhitecloud Jun 19, 2023
55f90b8
comp image
littlewhitecloud Jun 19, 2023
771ff1a
fix #37 & #38 and a small tweak
littlewhitecloud Jun 19, 2023
8b6d83a
Update example_ch.py
littlewhitecloud Jun 19, 2023
c2d507f
black, isort and small documents
littlewhitecloud Jun 19, 2023
328131a
black, isort and doc
littlewhitecloud Jun 19, 2023
148729b
Pep8?
littlewhitecloud Jun 19, 2023
2862412
Forgot this
littlewhitecloud Jun 19, 2023
b209fb7
bump version
littlewhitecloud Jun 21, 2023
86c8edf
Update README.md
littlewhitecloud Jun 22, 2023
bc78bb8
fix #41
littlewhitecloud Jun 22, 2023
877d7c9
fix #40
littlewhitecloud Jun 22, 2023
5a843ec
Update README_CH.md
littlewhitecloud Jun 22, 2023
d31b550
Update tkterm.py
littlewhitecloud Jun 22, 2023
ba639e8
fix typo
littlewhitecloud Jun 23, 2023
50c9c29
a better way to improve it
littlewhitecloud Jun 26, 2023
1fcf4f8
del usele
littlewhitecloud Jun 26, 2023
10b1649
small update
littlewhitecloud Jun 27, 2023
b91f5ac
also small updates
littlewhitecloud Jun 27, 2023
d679cd5
style...?
littlewhitecloud Jun 27, 2023
5d59a7d
also import styles
littlewhitecloud Jun 27, 2023
5768ac5
emm
littlewhitecloud Jun 27, 2023
bac57cd
rm CREATE_N?EW_CONSOLE
littlewhitecloud Jun 27, 2023
bcb4600
Update tkterm.py
littlewhitecloud Jun 27, 2023
fad58fc
make you happy :)
littlewhitecloud Jun 27, 2023
698d826
fix a lot
littlewhitecloud Jun 27, 2023
dd98a6c
black isort ruff merge variable name
littlewhitecloud Jun 27, 2023
8872473
type ann and isort
littlewhitecloud Jun 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ charset = utf-8
insert_final_newline = true

# Special file
[tktermwidget/term.py]
[tktermwidget/tkterm.py]
indent_style = space
indent_size = 4
end_of_line = lf
Expand All @@ -17,4 +17,4 @@ indent_style = space
indent_size = 4
end_of_line = lf
trim_trailing_whitespace = true
max_line_length = 88
max_line_length = 80
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
info.txt
.dist/
dist/
tkterm.egg-info/
tkterm/__pycache__/
tktermwidget.egg-info/
tktermwidget/__pycache__/
.DS_Store
.ruff_cache/
32 changes: 25 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,37 @@
<h1 align="center"> TkTerminal </h1>
A terminal emulator written in Python using tkinter

#### 🌏 [简体中文](README_CH.md)
[![PyPI](https://img.shields.io/pypi/v/tktermwidget)](https://pypi.org/project/tktermwidget)
![Platform](https://img.shields.io/powershellgallery/p/Pester?color=blue)

## Views:
### 🌏 [简体中文](README_CH.md)

```TkTerminal``` is a terminal emulator written in Python using tkinter. It is quite easy to use.
### Windows
<img src="images/windows.png" width="75%" align="center">

### MacOS
<img src="images/macos.png" width="85%" align="center">

## Features
- User can set the terminal widget with their own options
- Use \ to make new lines (On Windows it is &&)
- Command history recorder
- Styles
- And some on

## Future ideas
- Highlight

## Styles
littlewhitecloud marked this conversation as resolved.
Show resolved Hide resolved
```tkterminalwidget``` also have some styles to use such as ```Powershell``` ```Command```:
![image](https://github.com/littlewhitecloud/TkTerminal/assets/71159641/3affd018-0408-4e91-96de-4775937e0ab8)


## Installation:
```batch
pip install tktermwidget
```

## Example:
```python
from tkinter import Tk
Expand Down Expand Up @@ -53,7 +75,3 @@ root.deiconify()
root.mainloop()
```

## Install:
```batch
pip install tktermwidget
```
31 changes: 25 additions & 6 deletions README_CH.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,35 @@
<h1 align="center"> TkTerminal </h1>
使用 tkinter 用 Python 编写的终端模拟器

## 截图:
[![PyPI](https://img.shields.io/pypi/v/tktermwidget)](https://pypi.org/project/tktermwidget)
![Platform](https://img.shields.io/powershellgallery/p/Pester?color=blue)

```TkTermianl``` 是一个使用 tkinter 用 Python 编写的终端模拟器

### Windows
<img src="images/windows.png" width="75%" align="center">

### MacOS
<img src="images/macos.png" width="85%" align="center">

## 特征
- 用户可以使用他们自己的观点来设置终端控件,就像文本控件一样
- 用 \ 来输入新行 (Windows上是&&)
- 命令历史记录
- 风格
- 等等

## 未来想法
- 语法高亮

## 风格
```tkterminalwidget``` 也有一些主题可以用 比如 ```Powershell``` ```Command```
![image](https://github.com/littlewhitecloud/TkTerminal/assets/71159641/b1f7cfec-c5e7-48a0-be40-0c0f63fb959b)

## 安装:
```batch
pip install tktermwidget
```

## 样例:
```python
# -*- coding: gbk -*-
Expand Down Expand Up @@ -52,7 +74,4 @@ root.deiconify()
root.mainloop()
```

## 安装:
```batch
pip install tktermwidget
```

1 change: 1 addition & 0 deletions examples/example.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""An example for tktermwidget"""
from tkinter import Tk

from tktermwidget import Terminal
Expand Down
2 changes: 1 addition & 1 deletion examples/example_ch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: gbk -*-
"""An example for tktermwidget"""
from tkinter import Tk

from tktermwidget import Terminal
Expand Down
Binary file modified images/macos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/windows.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"""Setup for tktermwidget"""
from distutils.core import setup

with open("README.md", "r") as file:
long_description = file.read()

setup(
name="tktermwidget",
version="0.0.3",
version="0.0.4",
description="A terminal emulator for Tkinter",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
2 changes: 2 additions & 0 deletions tktermwidget/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
"""Tktermwidget package"""
from .style import Command, Defaulf, Powershell # noqa: F401
from .tkterm import Terminal # noqa: F401
27 changes: 27 additions & 0 deletions tktermwidget/style.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""Styles for terminal"""

Default: dict = { # Style for normal tkterminalwidget
"background": "#2B2B2B",
"insertbackground": "#DCDCDC",
"selectbackground": "#b4b3b3",
"selectforeground": "#e6e6e6",
"foreground": "#cccccc",
}

Powershell: dict = { # Style for powershell
"background": "#012456",
"insertbackground": "#eeedf0",
"selectbackground": "#fedba9",
"selectforeground": "#11120f",
"foreground": "#cccccc",
}

Command: dict = { # Style for normal "cmd.exe"
"background": "#000000",
"insertbackground": "#f2f2f2",
"selectbackground": "#f3f3f3",
"selectforeground": "#000000",
"foreground": "#f2f2f2",
}

# TODO: add a user custom style function later...
littlewhitecloud marked this conversation as resolved.
Show resolved Hide resolved
Loading