[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue common/setup.py common/packaging/debian/ch...
From: |
Jason Cater |
Subject: |
gnue common/setup.py common/packaging/debian/ch... |
Date: |
Thu, 10 Oct 2002 02:45:38 -0400 |
CVSROOT: /home/cvs
Module name: gnue
Changes by: Jason Cater <address@hidden> 02/10/10 02:45:36
Modified files:
common : setup.py
common/packaging/debian: changelog control rules
common/src/cursing: Button.py Dialog.py Label.py
ScreenContainer.py TextBox.py sio.py
designer/packaging/debian: changelog rules
forms/packaging/debian: changelog rules
forms/src : GFClient.py
forms/src/uidrivers/nstti: UIdriver.py
Log message:
added a login popup dialog for curses uidriver; beat the curses
uidriver into submission to get it to draw pages, labels, and entries; more
cleanup on common's curses library
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/setup.py.diff?cvsroot=OldCVS&tr1=1.44&tr2=1.45&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/packaging/debian/changelog.diff?cvsroot=OldCVS&tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/packaging/debian/control.diff?cvsroot=OldCVS&tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/packaging/debian/rules.diff?cvsroot=OldCVS&tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/Button.py.diff?cvsroot=OldCVS&tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/Dialog.py.diff?cvsroot=OldCVS&tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/Label.py.diff?cvsroot=OldCVS&tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/ScreenContainer.py.diff?cvsroot=OldCVS&tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/TextBox.py.diff?cvsroot=OldCVS&tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/sio.py.diff?cvsroot=OldCVS&tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/packaging/debian/changelog.diff?cvsroot=OldCVS&tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/packaging/debian/rules.diff?cvsroot=OldCVS&tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/packaging/debian/changelog.diff?cvsroot=OldCVS&tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/packaging/debian/rules.diff?cvsroot=OldCVS&tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/src/GFClient.py.diff?cvsroot=OldCVS&tr1=1.49&tr2=1.50&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/src/uidrivers/nstti/UIdriver.py.diff?cvsroot=OldCVS&tr1=1.6&tr2=1.7&r1=text&r2=text
Patches:
Index: gnue/common/packaging/debian/changelog
diff -c gnue/common/packaging/debian/changelog:1.3
gnue/common/packaging/debian/changelog:1.4
*** gnue/common/packaging/debian/changelog:1.3 Sat Oct 5 03:16:47 2002
--- gnue/common/packaging/debian/changelog Thu Oct 10 02:45:35 2002
***************
*** 1,3 ****
--- 1,9 ----
+ gnue-common (0.4.0-2) unstable; urgency=low
+
+ * Added python21-mxdatetime as a requirement
+
+ -- Jason Cater <address@hidden> Tue, 8 Oct 2002 23:28:05 -0500
+
gnue-common (0.4.0-1) unstable; urgency=low
* Initial release.
Index: gnue/common/packaging/debian/control
diff -c gnue/common/packaging/debian/control:1.6
gnue/common/packaging/debian/control:1.7
*** gnue/common/packaging/debian/control:1.6 Tue Oct 8 23:59:15 2002
--- gnue/common/packaging/debian/control Thu Oct 10 02:45:35 2002
***************
*** 8,12 ****
Package: gnue-common
Architecture: any
Depends: python2.1 (>= 2.1.3-1), python2.1-egenix-mxdatetime (>= 2.0.3-1),
${shlibs:Depends}
! Suggests: gnue-reports, gnue-forms
Description: A Free enterprise tool system.
--- 8,14 ----
Package: gnue-common
Architecture: any
Depends: python2.1 (>= 2.1.3-1), python2.1-egenix-mxdatetime (>= 2.0.3-1),
${shlibs:Depends}
! Recommends: gnue-reports, gnue-forms
! Suggests: gnue-designer, python2.1-psycopg, python2.1-mysqldb
Description: A Free enterprise tool system.
+
Index: gnue/common/packaging/debian/rules
diff -c gnue/common/packaging/debian/rules:1.3
gnue/common/packaging/debian/rules:1.4
*** gnue/common/packaging/debian/rules:1.3 Sat Oct 5 03:16:47 2002
--- gnue/common/packaging/debian/rules Thu Oct 10 02:45:35 2002
***************
*** 10,17 ****
export GNUEBINDIR=/usr/bin
export GNUEVARDIR=/var/lib/gnue
export GNUEETCDIR=/etc/gnue
! export GNUESHAREDIR=/usr/lib/share/gnue
! export GNUEDOCDIR=/usr/lib/share/doc/gnue-common
python = python
d = debian/tmp
--- 10,17 ----
export GNUEBINDIR=/usr/bin
export GNUEVARDIR=/var/lib/gnue
export GNUEETCDIR=/etc/gnue
! export GNUESHAREDIR=/usr/share/gnue
! export GNUEDOCDIR=/usr/share/doc/gnue-common
python = python
d = debian/tmp
Index: gnue/common/setup.py
diff -c gnue/common/setup.py:1.44 gnue/common/setup.py:1.45
*** gnue/common/setup.py:1.44 Sat Oct 5 03:16:47 2002
--- gnue/common/setup.py Thu Oct 10 02:45:35 2002
***************
*** 292,298 ****
"gnue.common.commdrivers._parser",
"gnue.common.commdrivers._directory",
"gnue.common.commdrivers.xmlrpc",
! "gnue.common.commdrivers.pw_xmlrpc"
],
package_dir = {"gnue": 'gnue',
--- 292,299 ----
"gnue.common.commdrivers._parser",
"gnue.common.commdrivers._directory",
"gnue.common.commdrivers.xmlrpc",
! "gnue.common.commdrivers.pw_xmlrpc",
! "gnue.common.cursing"
],
package_dir = {"gnue": 'gnue',
Index: gnue/common/src/cursing/Button.py
diff -c gnue/common/src/cursing/Button.py:1.3
gnue/common/src/cursing/Button.py:1.4
*** gnue/common/src/cursing/Button.py:1.3 Wed Oct 9 23:42:11 2002
--- gnue/common/src/cursing/Button.py Thu Oct 10 02:45:35 2002
***************
*** 44,50 ****
self.H = 1
self.FOCUS = 0
self.CANGETFOCUS = 1
! self.CAPTION = Caption #
self.SetMethod("SYSGOTFOCUS", self.GotFocus) # system event
self.SetMethod("SYSLOSTFOCUS", self.LostFocus) # system event
self.SetMethod("SYSPAINT", self.Paint) # system event
--- 44,50 ----
self.H = 1
self.FOCUS = 0
self.CANGETFOCUS = 1
! self.CAPTION = Caption #
self.SetMethod("SYSGOTFOCUS", self.GotFocus) # system event
self.SetMethod("SYSLOSTFOCUS", self.LostFocus) # system event
self.SetMethod("SYSPAINT", self.Paint) # system event
***************
*** 53,58 ****
--- 53,59 ----
self.SetMethod("GOTFOCUS", None) # user event
self.SetMethod("SYSRUN", self.Run) # system event
self.EXITFORM = 0
+
def Run(self, v1, v2, v3): # handle user actions
Container = self.PARENT.SCREEN
if v1 :
***************
*** 64,70 ****
while 1:
ch = Container.GetChar()
if self.PARENT.BreakOrder(ch) :
! return
if self.active == 0:
return 0
if ch in (Container.TokNextField, Container.TokRightArrow):
--- 65,71 ----
while 1:
ch = Container.GetChar()
if self.PARENT.BreakOrder(ch) :
! return
if self.active == 0:
return 0
if ch in (Container.TokNextField, Container.TokRightArrow):
***************
*** 78,87 ****
if self.EXITFORM:
return(1)
self.ExecMethod("SYSGOTFOCUS", None, None, None)
def Paint(self, HaveFocus, v2, v3): # event args not used
"""
control's paint event
! There are two ways to tell if we have focus or not. HaveFocus will == 1
when
the user is sitting on the control **OR** the property FOCUS will .
But, as you see, this is controlled by the person creating the control.
"""
--- 79,89 ----
if self.EXITFORM:
return(1)
self.ExecMethod("SYSGOTFOCUS", None, None, None)
+
def Paint(self, HaveFocus, v2, v3): # event args not used
"""
control's paint event
! There are two ways to tell if we have focus or not. HaveFocus will == 1
when
the user is sitting on the control **OR** the property FOCUS will .
But, as you see, this is controlled by the person creating the control.
"""
***************
*** 102,109 ****
spaces = tAW - len(tCaption)
if spaces % 2 == 1:
spaces += 1
! leadingSpaces = spaces / 2
! spaces = leadingSpaces
if spaces + leadingSpaces + len(tCaption) > tAW:
leadingSpaces -= 1
elif spaces + leadingSpaces + len(tCaption) < tAW:
--- 104,111 ----
spaces = tAW - len(tCaption)
if spaces % 2 == 1:
spaces += 1
! leadingSpaces = spaces / 2
! spaces = leadingSpaces
if spaces + leadingSpaces + len(tCaption) > tAW:
leadingSpaces -= 1
elif spaces + leadingSpaces + len(tCaption) < tAW:
Index: gnue/common/src/cursing/Dialog.py
diff -c gnue/common/src/cursing/Dialog.py:1.3
gnue/common/src/cursing/Dialog.py:1.4
*** gnue/common/src/cursing/Dialog.py:1.3 Wed Oct 9 23:42:11 2002
--- gnue/common/src/cursing/Dialog.py Thu Oct 10 02:45:35 2002
***************
*** 64,79 ****
self._DialogWidth = c2 - c1
self._DialogHeight = r2 - r1
self.INSET = 0
! self.buffer = self.Screen().CaptureScreen(self.R1,
self.C1,
self.R2, self.C2)
def __del__(self):
! pass
def AddDialogControl(self, TheControl):
"""
! Make sure the control is visible in the limited area of the
dialog box
"""
cRow = TheControl.Y
--- 64,79 ----
self._DialogWidth = c2 - c1
self._DialogHeight = r2 - r1
self.INSET = 0
! self.buffer = self.Screen().CaptureScreen(self.R1,
self.C1,
self.R2, self.C2)
def __del__(self):
! pass
def AddDialogControl(self, TheControl):
"""
! Make sure the control is visible in the limited area of the
dialog box
"""
cRow = TheControl.Y
***************
*** 83,91 ****
TheControl.Y = cRow
TheControl.X = cCol
ScreenContainer.AddControl(self,TheControl)
def AddControl(self,control):
! self.AddDialogControl(control)
def _PaintBorder(self):
self.LoLight()
--- 83,92 ----
TheControl.Y = cRow
TheControl.X = cCol
ScreenContainer.AddControl(self,TheControl)
+ return TheControl
def AddControl(self,control):
! return self.AddDialogControl(control)
def _PaintBorder(self):
self.LoLight()
Index: gnue/common/src/cursing/Label.py
diff -c gnue/common/src/cursing/Label.py:1.3
gnue/common/src/cursing/Label.py:1.4
*** gnue/common/src/cursing/Label.py:1.3 Wed Oct 9 23:42:11 2002
--- gnue/common/src/cursing/Label.py Thu Oct 10 02:45:35 2002
***************
*** 39,64 ****
update events and the user can't interact with it.
"""
! def __init__(self, Parent, LabelName, Y, X, Caption, Width=0,
**properties):
apply (Control.__init__, (self, Parent, LabelName), properties)
self.PadHeight = 2 # pad the height by this much if multiline
self.PARENT = Parent
self.X = X
self.Y = Y
# for more carefully formatted output
! if Width == 0:
self.W = len(Caption)
- else:
- self.W = Width
! # if there are newlines in the Cation: set the height of this
# label appropriately
if search( "\n", Caption):
# "How many single Heights is this?"
! # if the very last character is a newline it is
# len(mylist) - 1, else, len(mylist)
# set the height to be two more than the count
mylist = split( Caption, "\n")
--- 39,73 ----
update events and the user can't interact with it.
"""
! def __init__(self, Parent, LabelName, Y, X, Caption, Width=0,
**properties):
apply (Control.__init__, (self, Parent, LabelName), properties)
self.PadHeight = 2 # pad the height by this much if multiline
self.PARENT = Parent
self.X = X
self.Y = Y
+ self.W = Width
+ self.CLASS = "LABEL"
+ self.CAPTION = Caption
+ self.CANGETFOCUS = 0
+ self.SetMethod("SYSPAINT", self.Paint)
+ self.SetMethod("SYSGOTFOCUS", None)
+ self.SetMethod("SYSLOSTFOCUS", None)
+
+ self.SetText(Caption)
+
+ def SetText (self, Caption):
# for more carefully formatted output
! if self.W == 0:
self.W = len(Caption)
! # if there are newlines in the Caption: set the height of this
# label appropriately
if search( "\n", Caption):
# "How many single Heights is this?"
! # if the very last character is a newline it is
# len(mylist) - 1, else, len(mylist)
# set the height to be two more than the count
mylist = split( Caption, "\n")
***************
*** 67,73 ****
if Caption[ len(Caption) -1] == "\n":
# "last char is newline. Send Height: %i" %% %(myht)
myht = len(mylist) - 1 + self.PadHeight
! else:
# "last char IS NOT newline"
# "Send Height: %i" % (myht)
myht = len(mylist) + self.PadHeight
--- 76,82 ----
if Caption[ len(Caption) -1] == "\n":
# "last char is newline. Send Height: %i" %% %(myht)
myht = len(mylist) - 1 + self.PadHeight
! else:
# "last char IS NOT newline"
# "Send Height: %i" % (myht)
myht = len(mylist) + self.PadHeight
***************
*** 77,89 ****
# otherwise, leave alone
else:
self.H = 1
-
- self.CLASS = "LABEL"
- self.CAPTION = Caption
- self.CANGETFOCUS = 0
- self.SetMethod("SYSPAINT", self.Paint)
- self.SetMethod("SYSGOTFOCUS", None)
- self.SetMethod("SYSLOSTFOCUS", None)
def Paint(self, v1, v2, v3):
Container = self.PARENT.Screen()
--- 86,91 ----
Index: gnue/common/src/cursing/ScreenContainer.py
diff -c gnue/common/src/cursing/ScreenContainer.py:1.3
gnue/common/src/cursing/ScreenContainer.py:1.4
*** gnue/common/src/cursing/ScreenContainer.py:1.3 Wed Oct 9 23:42:11 2002
--- gnue/common/src/cursing/ScreenContainer.py Thu Oct 10 02:45:35 2002
***************
*** 81,86 ****
--- 81,88 ----
ControlObj.Y+ ControlObj.H,
ControlObj.X+ ControlObj.W)
+ return ControlObj
+
def DelControl(self,ControlObj = None):
"""Delete a control from the Control stack, and it's dimension
Index: gnue/common/src/cursing/TextBox.py
diff -c gnue/common/src/cursing/TextBox.py:1.4
gnue/common/src/cursing/TextBox.py:1.5
*** gnue/common/src/cursing/TextBox.py:1.4 Thu Oct 10 01:23:35 2002
--- gnue/common/src/cursing/TextBox.py Thu Oct 10 02:45:35 2002
***************
*** 37,47 ****
An example textbox control. Allows the user to enter text. Only
basic editing though
"""
! def __init__(self, Parent, TextboxName, Y, X, W, DefaultValue="",
password=0,
**properties):
apply(Control.__init__, (self, Parent, TextboxName), properties)
self.PARENT = Parent
self.CLASS = "TEXTBOX"
self.X = X
self.Y = Y
self.W = W
--- 37,48 ----
An example textbox control. Allows the user to enter text. Only
basic editing though
"""
! def __init__(self, Parent, TextboxName, Y, X, W, DefaultValue="",
Password=0,
**properties):
apply(Control.__init__, (self, Parent, TextboxName), properties)
self.PARENT = Parent
self.CLASS = "TEXTBOX"
+ self.PASSWORD = Password
self.X = X
self.Y = Y
self.W = W
***************
*** 146,152 ****
def Paint(self, v1, v2, v3):
Container = self.PARENT.Screen()
! TextLen = len(Text)
if self.PASSWORD:
Text = "*" * TextLen
--- 147,153 ----
def Paint(self, v1, v2, v3):
Container = self.PARENT.Screen()
! TextLen = len(self.TEXT)
if self.PASSWORD:
Text = "*" * TextLen
Index: gnue/common/src/cursing/sio.py
diff -c gnue/common/src/cursing/sio.py:1.3 gnue/common/src/cursing/sio.py:1.4
*** gnue/common/src/cursing/sio.py:1.3 Wed Oct 9 23:42:11 2002
--- gnue/common/src/cursing/sio.py Thu Oct 10 02:45:35 2002
***************
*** 327,331 ****
"""
"""
self.s.refresh()
-
-
--- 327,329 ----
Index: gnue/designer/packaging/debian/changelog
diff -c gnue/designer/packaging/debian/changelog:1.1
gnue/designer/packaging/debian/changelog:1.2
*** gnue/designer/packaging/debian/changelog:1.1 Sat Oct 5 03:16:48 2002
--- gnue/designer/packaging/debian/changelog Thu Oct 10 02:45:35 2002
***************
*** 1,3 ****
--- 1,10 ----
+ gnue-designer (0.4.0-2) unstable; urgency=low
+
+ * Fixed the incorrect assignment of /etc/gnue/connections.conf
+ (was being references incorrectly as /usr/local/gnue/connections.conf)
+
+ -- Jason Cater <address@hidden> Tue, 8 Oct 2002 23:28:05 -0500
+
gnue-designer (0.4.0-1) unstable; urgency=low
* Initial release.
Index: gnue/designer/packaging/debian/rules
diff -c gnue/designer/packaging/debian/rules:1.1
gnue/designer/packaging/debian/rules:1.2
*** gnue/designer/packaging/debian/rules:1.1 Sat Oct 5 03:16:48 2002
--- gnue/designer/packaging/debian/rules Thu Oct 10 02:45:35 2002
***************
*** 81,87 ****
if cmp --quiet $$i $$i.temp; then \
rm -f $$i.temp; \
else \
! cat $$i.temp |sed "s,'stage,'/usr/lib/gnue," > $$i; \
rm -f $$i.temp; \
chmod 755 $$i; \
echo "fixed interpreter: $$i"; \
--- 81,87 ----
if cmp --quiet $$i $$i.temp; then \
rm -f $$i.temp; \
else \
! cat $$i.temp |sed "s,'stage,'/usr/lib/gnue,"|sed
"s,'/usr/lib/gnue/etc/connections.conf','/etc/gnue/connections.conf'," > $$i; \
rm -f $$i.temp; \
chmod 755 $$i; \
echo "fixed interpreter: $$i"; \
Index: gnue/forms/packaging/debian/changelog
diff -c gnue/forms/packaging/debian/changelog:1.3
gnue/forms/packaging/debian/changelog:1.4
*** gnue/forms/packaging/debian/changelog:1.3 Sat Oct 5 03:16:48 2002
--- gnue/forms/packaging/debian/changelog Thu Oct 10 02:45:35 2002
***************
*** 1,3 ****
--- 1,10 ----
+ gnue-forms-wxgtk (0.4.0-2) unstable; urgency=low
+
+ * Fixed the incorrect assignment of /etc/gnue/connections.conf
+ (was being references incorrectly as /usr/local/gnue/connections.conf)
+
+ -- Jason Cater <address@hidden> Tue, 8 Oct 2002 23:28:05 -0500
+
gnue-forms-wxgtk (0.4.0-1) unstable; urgency=low
* Initial release.
Index: gnue/forms/packaging/debian/rules
diff -c gnue/forms/packaging/debian/rules:1.4
gnue/forms/packaging/debian/rules:1.5
*** gnue/forms/packaging/debian/rules:1.4 Sat Oct 5 03:16:48 2002
--- gnue/forms/packaging/debian/rules Thu Oct 10 02:45:35 2002
***************
*** 36,42 ****
-o -name Makefile.pre.in \
-o -name sedscript -o -name config.c \
| xargs rm -f
! rm -f setup.cfg
rm -rf stage
rm -rf build
dh_clean
--- 36,42 ----
-o -name Makefile.pre.in \
-o -name sedscript -o -name config.c \
| xargs rm -f
! rm -f setup.cfg
rm -rf stage
rm -rf build
dh_clean
***************
*** 83,89 ****
if cmp --quiet $$i $$i.temp; then \
rm -f $$i.temp; \
else \
! cat $$i.temp |sed "s,'stage,'/usr/lib/gnue," > $$i; \
rm -f $$i.temp; \
chmod 755 $$i; \
echo "fixed interpreter: $$i"; \
--- 83,89 ----
if cmp --quiet $$i $$i.temp; then \
rm -f $$i.temp; \
else \
! cat $$i.temp |sed "s,'stage,'/usr/lib/gnue,"|sed
"s,'/usr/lib/gnue/etc/connections.conf','/etc/gnue/connections.conf'," > $$i; \
rm -f $$i.temp; \
chmod 755 $$i; \
echo "fixed interpreter: $$i"; \
Index: gnue/forms/src/GFClient.py
diff -c gnue/forms/src/GFClient.py:1.49 gnue/forms/src/GFClient.py:1.50
*** gnue/forms/src/GFClient.py:1.49 Tue Sep 17 11:27:45 2002
--- gnue/forms/src/GFClient.py Thu Oct 10 02:45:35 2002
***************
*** 56,65 ****
NAME = "GNUe Forms"
USAGE = GClientApp.USAGE + " file"
COMMAND_OPTIONS = [
! [ 'user_interface', 'u', 'user_interface', 1, 'wx', 'type',
_('The currently supported values for <type> are ') \
! +'wx(GUI), nttsi(curses)' ],
! [ 'splash_screen','s','no_splash', 0, None, None,
_('Disables the splash screen')]
]
SUMMARY = \
--- 56,65 ----
NAME = "GNUe Forms"
USAGE = GClientApp.USAGE + " file"
COMMAND_OPTIONS = [
! [ 'user_interface', 'u', 'interface', 1, 'wx', 'type',
_('The currently supported values for <type> are ') \
! +'wx (GUI), gtk2, and curses' ],
! [ 'splash_screen','s','no-splash', 0, None, None,
_('Disables the splash screen')]
]
SUMMARY = \
***************
*** 127,132 ****
--- 127,133 ----
# Initialize user interface (defaults to gui)
# If the DISPLAY var isn't set then switch to text
uiloaded = 0
+ # TODO: change name from nstti to curses
while not uiloaded:
try:
self._ui = dyn_import("gnue.forms.uidrivers.%s" % (self.ui_type))
***************
*** 135,140 ****
--- 136,142 ----
GDebug.printMesg(1,_("Unable to load UI driver")+" %s" % self.ui_type)
GDebug.printMesg(1,err)
if self.ui_type != 'nstti':
+ ## TODO: curses
self.ui_type = 'nstti'
else:
self.handleStartupError(_("Unable to load any valid UI drivers.
Aborting."))
Index: gnue/forms/src/uidrivers/nstti/UIdriver.py
diff -c gnue/forms/src/uidrivers/nstti/UIdriver.py:1.6
gnue/forms/src/uidrivers/nstti/UIdriver.py:1.7
*** gnue/forms/src/uidrivers/nstti/UIdriver.py:1.6 Tue Oct 8 20:03:30 2002
--- gnue/forms/src/uidrivers/nstti/UIdriver.py Thu Oct 10 02:45:36 2002
***************
*** 1,6 ****
-
- #
- # Copyright 2000-2002 Free Software Foundation
#
# This file is part of GNU Enterprise.
#
--- 1,3 ----
***************
*** 19,36 ****
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
# FILE:
# UIdriver.py
#
# DESCRIPTION:
! # A nstti based user interface driver for GNUE forms.
! # (nstti : The Not So Tiny Text Interface)
! #
http://tomte.freezope.org/td_content_level_1/code_snippets/td_content_level_2/0_nstti/
#
# NOTES:
#
! from nstti import *
import curses
from gnue.forms.GFForm import *
--- 16,33 ----
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
+ # Copyright 2000-2002 Free Software Foundation
+ #
# FILE:
# UIdriver.py
#
# DESCRIPTION:
! # A curses based user interface driver for GNUE forms.
#
# NOTES:
#
! from gnue.common.cursing import *
import curses
from gnue.forms.GFForm import *
***************
*** 56,61 ****
--- 53,68 ----
_IdToGFObj = {}
_IdToUIObj = {}
+
+ _SIO = None
+
+ def GetSIO():
+ global _SIO
+ if not _SIO:
+ _SIO = sio()
+ _SIO.BeginScreenAccess()
+ return _SIO
+
#
# GFUserInterface
#
***************
*** 92,111 ****
#
# init
#
- # Routine called by wxWindows when wxApp instance is created
- # It is used the build the basic UI
#
def init(self):
- self._init()
-
- def _init(self):
#
# Create the main window
#
! self._screen = sio()
! self._screen.BeginScreenAccess()
self.mainWindow = ScreenContainer(self._screen)
! #self._screen.Cls()
#
# SplashScreen
--- 99,112 ----
#
# init
#
#
def init(self):
#
# Create the main window
#
! self._screen = GetSIO()
self.mainWindow = ScreenContainer(self._screen)
! self._screen.Cls()
#
# SplashScreen
***************
*** 119,127 ****
# MsgBoxOK(self.mainWindow, text).Show()
! self.mainWindow.panel = Dialog(self.mainWindow, 0, 0,
self._screen.MAXROW, self._screen.MAXCOL )
! self.currentWidget = [self.mainWindow.panel]
menu = {'file':[ {'id' :100,
--- 120,128 ----
# MsgBoxOK(self.mainWindow, text).Show()
! # self.mainWindow.panel = Dialog(self.mainWindow, 0, 0,
self._screen.MAXROW, self._screen.MAXCOL )
! self.currentWidget = [self.mainWindow]
menu = {'file':[ {'id' :100,
***************
*** 203,217 ****
self.textHeight = 1 # The pixel height of text inside a widget
! ## menuBar = MenuBar(self.mainWindow,0,0)
! ##
! ## for _menu in menu.keys():
! ## newMenu=menuBar.NewMenu(_menu,_menu)
! ## for menuitem in menu[_menu]:
! ## if menuitem['id'] > 0:
! ## newMenu.AddItem(menuitem['id'],menuitem['text'])
! ## else:
! ## newMenu.InsertSeperator()
## newMenu.Finalize()
## self.mainWindow.AddControl(menuBar)
--- 204,218 ----
self.textHeight = 1 # The pixel height of text inside a widget
! menuBar = MenuBar(self.mainWindow,0,0)
!
! for _menu in menu.keys():
! newMenu=menuBar.NewMenu(_menu,_menu)
! for menuitem in menu[_menu]:
! if menuitem['id'] > 0:
! newMenu.AddItem(menuitem['id'],menuitem['text'])
! else:
! newMenu.InsertSeperator()
## newMenu.Finalize()
## self.mainWindow.AddControl(menuBar)
***************
*** 221,236 ****
print "Activated!"
width = int(self._form.width)
height = int(self._form.height)
- ## self.currentWidget[0].RunDialog()
- ## sys.exit()
- pass
## formSize = wxSize(width*int(self.widgetWidth),
##
int(height+self.menu_sb_space)*int(self.widgetHeight))
## self.mainWindow.SetSize(formSize)
## self.mainWindow.SetTitle(str(self._form.title))
! ## self.mainWindow.panel = self._pageList[0]
## self.mainWindow.panel.SetSize(formSize)
## self._pageList[0].Show(1)
--- 222,234 ----
print "Activated!"
width = int(self._form.width)
height = int(self._form.height)
## formSize = wxSize(width*int(self.widgetWidth),
##
int(height+self.menu_sb_space)*int(self.widgetHeight))
## self.mainWindow.SetSize(formSize)
## self.mainWindow.SetTitle(str(self._form.title))
! self.mainWindow.panel = self._pageList[0]
## self.mainWindow.panel.SetSize(formSize)
## self._pageList[0].Show(1)
***************
*** 267,272 ****
--- 265,283 ----
def _setStatusBar(self,*args):
pass
+
+
+ # Can be used by UI drivers to add more attributes to the creation event.
+ def _updateCreateEvent(self, event):
+ event.eventHandler = self.dispatchEvent
+ event.ui = self
+ event.formWidth = int(self._form.width)
+ event.formHeight = int(self._form.height)
+ event.screenHeight = self._screen.MAXROW - 3
+ event.screenWidth = self._screen.MAXCOL
+ return event
+
+
#############################################################################
#
# Incoming Event Processors
***************
*** 282,288 ****
#
def mainLoop(self):
print "mainLoop"
! self.mainWindow.Run()
#
# gotoPage
--- 293,302 ----
#
def mainLoop(self):
print "mainLoop"
! # print "mainWindow.run()"
! self.mainWindow.panel.RunDialog()
! print self.mainWindow._pageList
! # self.mainWindow.Run()
#
# gotoPage
***************
*** 323,329 ****
def endWait (self, event):
print "Off yer keesteers!"
-
#############################################################################
#
# Internal Event Processors
--- 337,342 ----
***************
*** 348,354 ****
def promptForRecordNumber(self, event= None):
pass
!
#
# closeTrap
#
--- 361,367 ----
def promptForRecordNumber(self, event= None):
pass
!
#
# closeTrap
#
***************
*** 442,449 ****
def _createWidget(self, event, spacer):
object = event.object
style = self.alignmentStyle[object.alignment]
! print "Label Alert!!! %s" % event.container
! newWidget =
Label(event.container,'name',object.y,object.x,str(object.text))
return newWidget
#
--- 455,463 ----
def _createWidget(self, event, spacer):
object = event.object
style = self.alignmentStyle[object.alignment]
! GDebug.printMesg(0,"*****Label Alert!!! (x,y)=(%s,%s) %s" % (object.x,
object.y,event.container))
! newWidget =
Label(event.container,str(self),object.y,object.x,str(object.text))
! event.container.AddControl(newWidget)
return newWidget
#
***************
*** 507,515 ****
class UIPage(UIHelper, UIWidget):
def _createWidget(self, event, spacer):
object = event.object
! print "Created a page %s" % self
! newWidget = Dialog(event.container, 0, 0, event.widgetWidth,
event.widgetHeight )
! ###newWidget.DeActivate(tiFALSE)
event.interface._pageList.append(newWidget)
return newWidget
--- 521,549 ----
class UIPage(UIHelper, UIWidget):
def _createWidget(self, event, spacer):
object = event.object
! GDebug.printMesg(2,"Created a page %s (%s,%s)" %
(self,event.widgetWidth, event.widgetHeight))
! width = event.formWidth + 2
! height = event.formHeight + 2
! x = int(event.screenWidth/2 - width/2)
! y = int(event.screenHeight/2 - height/2)
!
! # For the menu bar
! if y < 2:
! y = 2
! # For sanity
! if x < 0:
! x = 0
! if y + height > event.screenHeight - 3:
! height = event.screenHeight - 3
! if x + width > event.screenWidth- 2:
! width = event.screenWidth
!
! GDebug.printMesg(2,'event dict=%s' % event.__dict__)
! GDebug.printMesg(2,'x,y,w,h = %s,%s,%s,%s' % (x,y,width, height))
!
!
! newWidget = Dialog(event.container, y, x, y+height-1, x+width-1 )
! ###newWidget.DeActivate(0)
event.interface._pageList.append(newWidget)
return newWidget
***************
*** 537,542 ****
--- 571,580 ----
newWidget = CheckBox(event.container, 'name',object.y,object.x,'',0)
else: # Normal text box
newWidget = TextBox(event.container, 'name', object.y, object.x,
object.width)
+
+ GDebug.printMesg(2,"*****Entry Alert!!! (x,y)=(%s,%s) %s" % (object.x,
object.y,event.container))
+ event.container.AddControl(newWidget)
+
return newWidget
#
***************
*** 628,634 ****
## self._eventProcessor = eventProcessor
## for eventType in eventList:
## self.Connect(-1, -1, eventType,self._processEvent)
!
## def _processEvent(self,event):
## GDebug.printMesg(0,"uiBaseEvtHandler _processEvent was called?!?")
--- 666,672 ----
## self._eventProcessor = eventProcessor
## for eventType in eventList:
## self.Connect(-1, -1, eventType,self._processEvent)
!
## def _processEvent(self,event):
## GDebug.printMesg(0,"uiBaseEvtHandler _processEvent was called?!?")
***************
*** 685,691 ****
## else:
## try:
## action = GFEvent('requestKEYPRESS', chr(event.KeyCode()),
! ## text=chr(event.KeyCode()),
## code=event.KeyCode())
## except ValueError:
## pass #event.Skip()
--- 723,729 ----
## else:
## try:
## action = GFEvent('requestKEYPRESS', chr(event.KeyCode()),
! ## text=chr(event.KeyCode()),
## code=event.KeyCode())
## except ValueError:
## pass #event.Skip()
***************
*** 703,890 ****
# UILoginHandler
#
class UILoginHandler(GLoginHandler.LoginHandler):
- pass
## def __init__(self):
## self._wxapp = getWxApp()
## self.dlg = None
-
- ## def getLogin(self, loginData):
- ## if 1: # TODO: This is left here to prevent me from having to unindent
this code
- ## # TODO: Since the UI stuff is currently being gutted I'm not
wasting the time
- ## # TODO: to do the right thing
- ## if len(loginData[1]):
- ## loginMesg = 'Login required for "%s"' % (loginData[1])
- ## else:
- ## loginMesg = 'Login required for %s' % (loginData[0])
-
- ## self.dlg = wxDialog(NULL, -1, "GNU Enterprise: Login")
- ## self.dlg.SetAutoLayout(true)
-
- ## bmp = wxImage(os.environ['INSTALL_PREFIX']+'/'+gConfig('smallPNG'),
wxBITMAP_TYPE_PNG).ConvertToBitmap()
-
- ## self.textctrlList = []
- ## messageField = wxStaticText(self.dlg, 1010, str(loginMesg))
- ## labelList = []
-
- ## dlgWidth = max(bmp.GetWidth(), messageField.GetSize().GetWidth()+20)
-
- ## dlgHeight = bmp.GetHeight() + messageField.GetSize().GetHeight() + 80
-
- ## xSpacing = 0
- ## ySpacing = 0
- ## fieldLabelWidth = 0
-
- ## for prompt in loginData[2]:
- ## s = wxStaticText(self.dlg, 1010, '%s:' % prompt[1])
- ## labelList.append(s)
- ## if prompt[2]:
- ## t = wxTextCtrl(self.dlg, -1,"",wxPoint(1, 1), wxSize(150, 20),
style=wxTE_PASSWORD|wxTE_PROCESS_ENTER)
- ## else:
- ## t = wxTextCtrl(self.dlg, -1,"",wxPoint(1, 1), wxSize(150, 20),
style=wxTE_PROCESS_ENTER)
-
- ## myID = len(self.textctrlList)
- ## self.textctrlList.append(t)
- ## EVT_CHAR(t, LoginFieldHandler(self, myID).loginFieldEventTrap)
-
- ## fieldLabelWidth = max(fieldLabelWidth, \
- ## s.GetSize().GetWidth() +
t.GetSize().GetWidth() + 10)
-
- ## dlgWidth = max(dlgWidth, \
- ## s.GetSize().GetWidth() +
t.GetSize().GetWidth() + 10)
-
- ## xSpacing = max(xSpacing, s.GetSize().GetWidth())
- ## ySpacing = max(ySpacing, s.GetSize().GetHeight())
- ## ySpacing = max(ySpacing, t.GetSize().GetHeight())
-
-
- ## loginButton = wxButton(self.dlg,19998,'Login')
- ## cancelButton = wxButton(self.dlg,19999,'Cancel')
-
- ## EVT_BUTTON(self.dlg, 19998, self.loginButtonEventTrap)
- ## EVT_BUTTON(self.dlg, 19999, self.loginCancelEventTrap)
- ## dlgWidth = max(dlgWidth, loginButton.GetSize().GetWidth() +
- ## cancelButton.GetSize().GetWidth() + 6) + 20
-
- ## dlgHeight += max(loginButton.GetSize().GetHeight(),
- ## cancelButton.GetSize().GetHeight()) - 6
-
- ## firstY = bmp.GetHeight() + messageField.GetSize().GetHeight() + 50
- ## lastY = firstY
- ## xSpacing += 10 # Add whitespace between widgets
- ## ySpacing += 6 # Add whitespace between widgets
- ## xPos = dlgWidth/2 - fieldLabelWidth/2
-
-
- ## # Move the fields and labels into position
- ## for i in range(0, len(self.textctrlList)):
- ## dlgHeight = dlgHeight + ySpacing
- ## labelList[i].SetPosition(wxPoint(xPos, lastY))
- ## self.textctrlList[i].SetPosition(wxPoint(xPos + xSpacing, lastY))
- ## lastY = lastY + ySpacing
-
- ## # Set the focus to the first text entry field
- ## self.textctrlList[0].SetFocus()
-
- ## # Create and position the logo
- ## wxStaticBitmap(self.dlg,-1, bmp,
- ## wxPoint((dlgWidth-bmp.GetWidth())/2, 12),
- ## wxSize(bmp.GetWidth(), bmp.GetHeight()))
-
- ## # Move the various widgets into position
- ## messageField.SetPosition(
- ## wxPoint(dlgWidth/2 - messageField.GetSize().GetWidth()/2,
- ## 30 + bmp.GetHeight()))
-
- ## cancelButton.SetPosition(
- ## wxPoint(dlgWidth - 10 - cancelButton.GetSize().GetWidth(),
- ## dlgHeight - 10 - max(loginButton.GetSize().GetHeight(),
- ##
cancelButton.GetSize().GetHeight())))
- ## loginButton.SetPosition(
- ## wxPoint(dlgWidth - 16 - cancelButton.GetSize().GetWidth() - \
- ## loginButton.GetSize().GetWidth(),
- ## dlgHeight - 10 - max(loginButton.GetSize().GetHeight(),
- ##
cancelButton.GetSize().GetHeight())))
-
- ## self.loginButton = loginButton
-
- ## self.dlg.SetSize(wxSize(dlgWidth, dlgHeight))
-
-
- ## self.dlg.Refresh()
- ## self.dlg.Fit()
- ## self.dlg.Raise()
- ## self.dlg.CenterOnScreen()
-
-
- ## # If user cancels, this will be set to 0
- ## self._completed = 0
- ## self.dlg.ShowModal()
-
- ## if not self._completed:
- ## raise GLoginHandler.UserCanceledLogin
-
- ## rv = {}
- ## for i in range(0, len(loginData[2])):
- ## rv[loginData[2][i][0]] = self.textctrlList[i].GetValue()
-
- ## return rv
-
- ## #
- ## # Login is completed, for whatever reason
- ## #
- ## def loginCompleted(self, successful):
- ## self._completed = successful
- ## self.dlg.EndModal(1)
-
- ## #
- ## # Called when user clicks "login"
- ## #
- ## def loginButtonEventTrap(self, event):
- ## self.loginCompleted(1)
-
- ## #
- ## # Called when user clicks "cancel"
- ## #
- ## def loginCancelEventTrap(self, event):
- ## self.loginCompleted(0)
-
- ## #
- ## # TODO: This is a hack required because windows
- ## # TODO: seems to have issues with wxWindows dialogs
- ## #
- ## def destroyLoginDialog(self):
- ## self.dlg.Destroy()
-
- ## #
- ## # LoginFieldHandler
- ## #
- ## # Used by the login handler
- ## # enables the user to press return and have it jump to the next box
- ## #
- ## class LoginFieldHandler:
- ## def __init__(self, app, seq):
- ## self.app = app
- ## self.seq = seq
-
- ## def loginFieldEventTrap(self, event):
- ## if event.KeyCode() in (WXK_RETURN, WXK_TAB):
- ## if self.seq < len(self.app.textctrlList) - 1:
- ## self.app.textctrlList[self.seq+1].SetFocus()
- ## else:
- ## if event.KeyCode() == WXK_TAB:
- ## if event.ShiftDown():
- ## self.app.textctrlList[self.seq-1].SetFocus()
- ## else:
- ## self.app.loginButton.SetFocus()
- ## else:
- ## self.app.loginCompleted(1)
- ## else:
- ## event.Skip()
-
-
-
-
-
--- 741,828 ----
# UILoginHandler
#
class UILoginHandler(GLoginHandler.LoginHandler):
## def __init__(self):
## self._wxapp = getWxApp()
## self.dlg = None
+ def getLogin(self, loginData, errorText=None):
+ if 1: # TODO: This is left here to prevent me from having to unindent
this code
+ # TODO: Since the UI stuff is currently being gutted I'm not
wasting the time
+ # TODO: to do the right thing
+
+ # Get the screen
+ root = GetSIO()
+ screen = ScreenContainer(root)
+
+ if len(loginData[1]):
+ loginMesg = 'Login required for "%s"' % (loginData[1])
+ else:
+ loginMesg = 'Login required for %s' % (loginData[0])
+
+ gnueMesg = _("GNU Enteprise Forms")
+
+ dlgWidth = max(len(loginMesg), len(gnueMesg)) + 4
+ dlgHeight = 5
+
+ labelList = []
+ textctrlList = []
+ labelMsgList = []
+
+ fieldLabelWidth = 0
+
+ for prompt in loginData[2]:
+ labelMsgList.append('%s:' % prompt[1])
+ fieldLabelWidth = max(fieldLabelWidth, len ('%s:' % prompt[1]))
+ dlgWidth = max(dlgWidth, fieldLabelWidth + 23)
+ dlgHeight += 1
+
+ lbMesg = _('Login')
+ cbMesg = _('Cancel')
+ dlgWidth = max(dlgWidth, len(lbMesg) + len(cbMesg) + 11) + 2
+ dlgHeight += 1
+
+ #
+ # Create widgets
+ #
+
+ w = dlgWidth + 2
+ h = dlgHeight + 2
+ x = int(root.MAXCOL/2 - w/2 + .5)
+ y = int(root.MAXROW/2 - h/2 + .5)
+
+ dlg = dlg = Dialog(screen, y, x, y+h-1, x+w-1 )
+
+ gnueLabel = dlg.AddDialogControl(Label(dlg, "lbl1", 1,
+ int((dlgWidth - len(gnueMesg))/2),
+ gnueMesg))
+ loginLabel = dlg.AddDialogControl(Label(dlg, "lbl1", 2,
+ int((dlgWidth - len(loginMesg))/2),
+ loginMesg))
+
+ firstY = 4
+ lastY = firstY
+ xPos = int(dlgWidth/2 - fieldLabelWidth/2) - 11
+
+ for prompt in loginData[2]:
+ s = dlg.AddDialogControl(Label(dlg,"lbl2",lastY, xPos,'%s:' %
prompt[1]))
+ labelList.append(s)
+ t = dlg.AddDialogControl(TextBox(dlg, "inp", lastY, xPos +
fieldLabelWidth + 2, 20, Password=prompt[2]))
+ textctrlList.append(t)
+ lastY += 1
+
+ loginButton = dlg.AddDialogControl(Button(dlg,"LoginButton",dlgHeight
- 1,dlgWidth - len(cbMesg) - len(lbMesg) - 9,len(lbMesg)+4,lbMesg))
+ loginButton.EXITFORM = 1
+ cancelButton =
dlg.AddDialogControl(Button(dlg,"CancelButton",dlgHeight - 1,dlgWidth -
len(cbMesg) - 5,len(cbMesg)+4,cbMesg))
+ cancelButton.EXITFORM = 1
+
+ t = dlg.RunDialog()
+
+ if dlg.Controls[t] == cancelButton:
+ raise GLoginHandler.UserCanceledLogin
+
+ rv = {}
+ for i in range(0, len(loginData[2])):
+ rv[loginData[2][i][0]] = textctrlList[i].TEXT
+ return rv
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue common/setup.py common/packaging/debian/ch...,
Jason Cater <=