Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
UCC
virtualsnack
Commits
5786dab3
Commit
5786dab3
authored
Oct 12, 2014
by
Mark Tearle
Browse files
Basic Date updating
parent
d67bac06
Changes
1
Hide whitespace changes
Inline
Side-by-side
virtualsnack.py
View file @
5786dab3
#!/usr/bin/env python
import
npyscreen
from
datetime
import
datetime
class
VirtualSnack
(
npyscreen
.
FormMutt
):
MAIN_WIDGET_CLASS
=
npyscreen
.
MultiLineEdit
class
VirtualSnack
(
npyscreen
.
Form
):
class
VirtualSnackApp
(
npyscreen
.
NPSApp
):
def
main
(
self
):
F
=
VirtualSnack
()
F
.
wStatus1
.
value
=
"Virtual Snack"
F
.
wStatus2
.
value
=
"Last Command"
F
.
edit
()
def
while_waiting
(
self
):
self
.
date_widget
.
value
=
datetime
.
now
()
self
.
display
()
def
create
(
self
,
*
args
,
**
keywords
):
super
(
VirtualSnack
,
self
).
create
(
*
args
,
**
keywords
)
self
.
wStatus1
=
self
.
add
(
npyscreen
.
FixedText
,
value
=
"Last Command"
,
editable
=
False
)
self
.
wStatus2
=
self
.
add
(
npyscreen
.
FixedText
,
value
=
""
,
editable
=
False
)
self
.
wStatus1
.
important
=
True
self
.
date_widget
=
self
.
add
(
npyscreen
.
FixedText
,
value
=
datetime
.
now
(),
editable
=
False
)
self
.
date_widget
.
value
=
"Hello"
class
VirtualSnackApp
(
npyscreen
.
NPSAppManaged
):
keypress_timeout_default
=
2
def
onStart
(
self
):
self
.
addForm
(
"MAIN"
,
VirtualSnack
,
name
=
"Virtual Snack"
)
if
__name__
==
"__main__"
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment