Skip to content

Commit a8e6870

Browse files
author
Richard Jones
committed
merge from HEAD
1 parent db705c0 commit a8e6870

File tree

6 files changed

+54
-66
lines changed

6 files changed

+54
-66
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Fixed:
1818
1119475)
1919
- better edit conflict handling (sf bug 1118790)
2020
- consistent text searching behaviour (AND everywhere) (sf bug 1101036)
21+
- fix handling of invalid date input (sf bug 1102165)
22+
- retain Boolean selections in edit error handling (sf bug 1101492)
2123

2224

2325
2005-01-13 0.8.0b2
@@ -89,6 +91,7 @@ Fixed:
8991
- quote full-text search text in URL generation
9092
- fixed problem migrating mysql databases
9193
- fix search_checkboxes macro (sf patch 1113828)
94+
- fix bug in date editing in Metakit
9295

9396

9497
2005-01-06 0.7.11

doc/announcement.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ First up, big thanks go to alexander smishlajev who has done some really
66
good work getting the i18n and new configuration components of this release
77
going.
88

9+
Please note that Roundup now requires python 2.3 or later.
10+
911
Version 0.8 introduces far too many features to list here so I've put
1012
together a What's New page:
1113

1214
http://roundup.sourceforge.net/doc-0.8/whatsnew-0.8.html
1315

14-
This is a bugfix release, fixing:
16+
0.8b3 is a bugfix release, fixing:
1517

1618
- note about how to run roundup demo in Windows (sf bug 1082090)
1719
- fix API for templating utils extensions - remove "utils" arg (sf bug 1081981)
@@ -28,7 +30,7 @@ This is a bugfix release, fixing:
2830
If you're upgrading from an older version of Roundup you *must* follow
2931
the "Software Upgrade" guidelines given in the maintenance documentation.
3032

31-
Roundup requires python 2.1.3 or later for correct operation.
33+
Roundup requires python 2.3 or later for correct operation.
3234

3335
To give Roundup a try, just download (see below), unpack and run::
3436

doc/installation.txt

Lines changed: 8 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Roundup scripts
3232
Prerequisites
3333
=============
3434

35-
Roundup requires Python 2.1.3 or newer with a functioning anydbm
35+
Roundup requires Python 2.3 or newer with a functioning anydbm
3636
module. Download the latest version from http://www.python.org/.
3737
It is highly recommended that users install the latest patch version
3838
of python as these contain many fixes to serious bugs.
@@ -42,40 +42,6 @@ distribution (at http://www.activestate.com/Products/ActivePython/), or you'll
4242
have to install the win32all package separately (get it from
4343
http://starship.python.net/crew/mhammond/win32/).
4444

45-
If you're using a version of Python older than 2.3, you may need
46-
to `install the "CSV" module`_.
47-
48-
Install the "CSV" module
49-
------------------------
50-
51-
.. hint::
52-
CSV stands for Comma-Separated-Value. These files are used by all
53-
manner of programs (eg. spreadsheets) to exchange data.
54-
55-
The "CSV" module is required if you wish to import or export data in the
56-
tracker, or if you wish to use the online generic class editing facility.
57-
58-
If you're using a version of Python older than 2.3, then you will need to
59-
install the "CSV" module from `Object Craft`_. Users of Python2.3 and later
60-
don't need to. If you have a C compiler installed, then download the source
61-
and follow their installation instructions (simply ``python setup.py
62-
install``.)
63-
64-
If you're on Windows and don't have a C compiler, then you'll need to
65-
download the pre-compiled ``csv.pyd`` file and install it. To install, just
66-
copy it to your Python installation in the ``lib\site-packages`` directory.
67-
For Python 2.2, this would be::
68-
69-
c:\python22\lib\site-packages
70-
71-
Once the CSV module is installed, you *must* restart roundup-server if it
72-
is already running, or the new module won't be detected.
73-
74-
If you're on some other platform and don't have a C compiler, you'll need
75-
to ask for help on the roundup-users mailing list.
76-
77-
.. _`Object Craft`: http://object-craft.com.au/
78-
7945

8046
Getting Roundup
8147
===============
@@ -95,16 +61,14 @@ folder names" check box is checked before you extract the files.
9561
For The Really Impatient
9662
========================
9763

98-
.. note::
99-
The ``demo.py`` script is packaged in Roundup's source distribution -
100-
users of the Windows installer may use the ``roundup-demo`` program.
101-
Users of other binary distributions or pre-installed Roundup will need
102-
to download the source to use it.
103-
10464
If you just want to give Roundup a whirl Right Now, then simply run
105-
``python demo.py``. This will set up a simple demo tracker on your
106-
machine. When it's done, it'll print out a URL to point your web browser
107-
at so you may start playing. Three users will be set up:
65+
``python demo.py``. If you used the Windows installer, you should run the
66+
``roundup-demo`` program instead. Users of other binary distributions or
67+
pre-installed Roundup will need to download the source to use it.
68+
69+
This will set up a simple demo tracker on your machine. When it's done,
70+
it'll print out a URL to point your web browser at so you may start
71+
playing. Three users will be set up:
10872

10973
1. anonymous - the "default" user with permission to do very little
11074
2. demo (password "demo") - a normal user who may create issues
@@ -736,9 +700,6 @@ Linux
736700

737701
Make sure you read the instructions under `UNIX environment steps`_.
738702

739-
Python 2.1.1 as shipped with SuSE7.3 might be missing module
740-
``_weakref``.
741-
742703

743704
Solaris
744705
-------

roundup/backends/back_metakit.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: back_metakit.py,v 1.88.2.1 2005-02-13 22:40:53 richard Exp $
1+
# $Id: back_metakit.py,v 1.88.2.2 2005-02-14 01:26:14 richard Exp $
22
'''Metakit backend for Roundup, originally by Gordon McMillan.
33
44
Known Current Bugs:
@@ -771,7 +771,10 @@ def set_inner(self, nodeid, **propvalues):
771771
setattr(row, key, 0)
772772
else:
773773
setattr(row, key, int(calendar.timegm(value.get_tuple())))
774-
changes[key] = str(oldvalue)
774+
if oldvalue is None:
775+
changes[key] = oldvalue
776+
else:
777+
changes[key] = str(oldvalue)
775778
propvalues[key] = str(value)
776779

777780
elif isinstance(prop, hyperdb.Interval):

roundup/cgi/templating.py

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -924,8 +924,11 @@ def history(self, direction='descending', dre=re.compile('^\d+$')):
924924
current[k] = old
925925

926926
elif isinstance(prop, hyperdb.Date) and args[k]:
927-
d = date.Date(args[k],
928-
translator=self._client).local(timezone)
927+
if args[k] is None:
928+
d = ''
929+
else:
930+
d = date.Date(args[k],
931+
translator=self._client).local(timezone)
929932
cell.append('%s: %s'%(self._(k), str(d)))
930933
if current.has_key(k):
931934
cell[-1] += ' -> %s' % current[k]
@@ -1320,8 +1323,13 @@ def field(self):
13201323
if not self.is_edit_ok():
13211324
return self.plain()
13221325

1323-
checked = self._value and "checked" or ""
1324-
if self._value:
1326+
value = self._value
1327+
if isinstance(value, str) or isinstance(value, unicode):
1328+
value = value.strip().lower() in ('checked', 'yes', 'true',
1329+
'on', '1')
1330+
1331+
checked = value and "checked" or ""
1332+
if value:
13251333
s = self.input(type="radio", name=self._formname, value="yes",
13261334
checked="checked")
13271335
s += 'Yes'
@@ -1343,7 +1351,8 @@ def __init__(self, client, classname, nodeid, prop, name, value,
13431351
anonymous=0, offset=None):
13441352
HTMLProperty.__init__(self, client, classname, nodeid, prop, name,
13451353
value, anonymous=anonymous)
1346-
if self._value:
1354+
if self._value and not (isinstance(self._value, str) or
1355+
isinstance(self._value, unicode)):
13471356
self._value.setTranslator(self._client.translator)
13481357
self._offset = offset
13491358

@@ -1399,7 +1408,9 @@ def field(self, size=30, default=None, format=_marker):
13991408
else:
14001409
return self.pretty(format)
14011410

1402-
if self._value is None:
1411+
value = self._value
1412+
1413+
if value is None:
14031414
if default is None:
14041415
raw_value = None
14051416
else:
@@ -1413,12 +1424,16 @@ def field(self, size=30, default=None, format=_marker):
14131424
raise ValueError, _('default value for '
14141425
'DateHTMLProperty must be either DateHTMLProperty '
14151426
'or string date representation.')
1427+
elif isinstance(value, str) or isinstance(value, unicode):
1428+
# most likely erroneous input to be passed back to user
1429+
value = cgi.escape(str(value), 1)
1430+
return self.input(name=self._formname, value=value, size=size)
14161431
else:
1417-
raw_value = self._value
1432+
raw_value = value
14181433

14191434
if raw_value is None:
14201435
value = ''
1421-
elif type(raw_value) is type(''):
1436+
elif isinstance(raw_value, str) or isinstance(raw_value, unicode):
14221437
if format is self._marker:
14231438
value = raw_value
14241439
else:
@@ -1621,8 +1636,8 @@ def menu(self, size=None, height=None, showid=0, additional=[],
16211636
options = linkcl.filter(None, conditions, sort_on, (None, None))
16221637

16231638
# make sure we list the current value if it's retired
1624-
if self._value and self._value not in options:
1625-
options.insert(0, self._value)
1639+
if value and value not in options:
1640+
options.insert(0, value)
16261641

16271642
for optionid in options:
16281643
# get the option value, and if it's None use an empty string
@@ -1636,6 +1651,8 @@ def menu(self, size=None, height=None, showid=0, additional=[],
16361651
# figure the label
16371652
if showid:
16381653
lab = '%s%s: %s'%(self._prop.classname, optionid, option)
1654+
elif not option:
1655+
lab = '%s%s'%(self._prop.classname, optionid)
16391656
else:
16401657
lab = option
16411658

roundup/date.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: date.py,v 1.77.2.1 2005-01-03 03:06:30 richard Exp $
18+
# $Id: date.py,v 1.77.2.2 2005-02-14 01:26:14 richard Exp $
1919

2020
"""Date, time and time interval handling.
2121
"""
@@ -152,7 +152,6 @@ def __init__(self, spec='.', offset=0, add_granularity=0, translator=i18n):
152152
except:
153153
raise ValueError, 'Unknown spec %r'%spec
154154

155-
usagespec='[yyyy]-[mm]-[dd].[H]H:MM[:SS.SSS][offset]'
156155
def set(self, spec, offset=0, date_re=re.compile(r'''
157156
((?P<y>\d\d\d\d)([/-](?P<m>\d\d?)([/-](?P<d>\d\d?))?)? # yyyy[-mm[-dd]]
158157
|(?P<a>\d\d?)[/-](?P<b>\d\d?))? # or mm-dd
@@ -177,7 +176,9 @@ def set(self, spec, offset=0, date_re=re.compile(r'''
177176
# not serialised data, try usual format
178177
m = date_re.match(spec)
179178
if m is None:
180-
raise ValueError, self._('Not a date spec: %s') % self.usagespec
179+
raise ValueError, self._('Not a date spec: '
180+
'"yyyy-mm-dd", "mm-dd", "HH:MM", "HH:MM:SS" or '
181+
'"yyyy-mm-dd.HH:MM:SS.SSS"')
181182

182183
info = m.groupdict()
183184

@@ -228,8 +229,9 @@ def set(self, spec, offset=0, date_re=re.compile(r'''
228229
try:
229230
self.applyInterval(Interval(info['o'], allowdate=0))
230231
except ValueError:
231-
raise ValueError, self._('%r not a date spec (%s)')%(spec,
232-
self.usagespec)
232+
raise ValueError, self._('%r not a date / time spec '
233+
'"yyyy-mm-dd", "mm-dd", "HH:MM", "HH:MM:SS" or '
234+
'"yyyy-mm-dd.HH:MM:SS.SSS"')%(spec,)
233235

234236
def addInterval(self, interval):
235237
''' Add the interval to this date, returning the date tuple

0 commit comments

Comments
 (0)