-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from gojuukaze/v2.1.4
V2.1.4
- Loading branch information
Showing
22 changed files
with
970 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import platform | ||
from terminal_layout import * | ||
from terminal_layout.extensions.scroll import * | ||
|
||
s = '''python2 - print "Hello, World!" | ||
python3 - print("Hello, World!") | ||
c - printf("Hello, World!") | ||
c++ - cout << "Hello, World!" << endl | ||
java - System.out.println("Hello, World!") | ||
JS - console.log('Hello, World!'); | ||
php - echo "Hello, World!" | ||
c# - Console.WriteLine("Hello, World!") | ||
shell - echo "Hello, World!" | ||
go - fmt.Println("Hello, World!") | ||
rust - println("Hello, World!")''' | ||
|
||
title_style = { | ||
'back': Back.magenta if platform.system() == 'Windows' else Back.ex_plum_2, | ||
'width': Width.fill, | ||
'gravity': Gravity.center | ||
|
||
} | ||
rows = [[], | ||
[TextView('title', 'Hello, World!', **title_style)], | ||
[TextView('', ' ', **title_style)], | ||
] | ||
|
||
scroll_style = { | ||
'back': Back.blue if platform.system() == 'Windows' else Back.ex_sky_blue_2, | ||
'fore': Fore.black | ||
} | ||
for i, ss in enumerate(s.split('\n')): | ||
lan, code = ss.split(' - ') | ||
rows.append([ | ||
TextView('', ' ' + str(i) + '.' + lan.title(), width=10, **scroll_style), | ||
TextView('', '| ' + code, width=Width.fill, **scroll_style) | ||
]) | ||
|
||
ctl = LayoutCtl.quick(TableLayout, rows) | ||
ctl.set_buffer_size(200) | ||
ctl.enable_debug(height=12) | ||
|
||
scroll = Scroll(ctl, stop_key='q', loop=True, more=True, scroll_box_start=3) | ||
scroll.scroll() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,36 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools>=42", | ||
"wheel" | ||
requires = ["setuptools>=61.0"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "terminal_layout" | ||
version = "2.1.4" | ||
authors = [ | ||
{ name="gojuukaze", email="ikaze_email@163.com" }, | ||
] | ||
build-backend = "setuptools.build_meta" | ||
description = "The project help you to quickly build layouts in terminal (命令行ui布局工具)" | ||
readme = "README.rst" | ||
requires-python = ">=2.7" | ||
classifiers = [ | ||
"Programming Language :: Python :: 2", | ||
"Programming Language :: Python :: 3", | ||
"Operating System :: OS Independent", | ||
"Environment :: Console", | ||
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)", | ||
"Development Status :: 5 - Production/Stable", | ||
"Topic :: Terminals", | ||
] | ||
|
||
dependencies = [ | ||
"colorama==0.4.4", | ||
'colored==1.3.93', | ||
] | ||
|
||
[project.urls] | ||
"Homepage" = "https://github.com/gojuukaze/terminal_layout" | ||
"Bug Tracker" = "https://github.com/gojuukaze/terminal_layout/issues" | ||
"Documentation"="https://doc.ikaze.cn/terminal_layout" | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["terminal_layout*"] | ||
exclude = ["demo", "tests"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.