Skip to content

Commit 6f97abe

Browse files
author
Richard Jones
committed
merge from HEAD
1 parent b9c6b5a commit 6f97abe

File tree

9 files changed

+154
-133
lines changed

9 files changed

+154
-133
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Fixed:
2424
is invalid (ie. when we try to bounce, we get a 550 "unknown user
2525
account" response from the SMTP server) (sf bug 1190906)
2626
- removed debugging code from cgi/actions.py
27+
- refactored hyperdb.rawToHyperdb, allowing a number of improvements
28+
(thanks Ralf Schlatterbeck)
2729

2830

2931
2005-05-02 0.8.3

doc/index.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ John P. Rouillard,
129129
Ollie Rutherfurd,
130130
Toby Sargeant,
131131
Giuseppe Scelsi,
132+
Ralf Schlatterbeck,
132133
Gregor Schmid,
133134
Florian Schulze,
134135
Klamer Schutte,

roundup/admin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818
#
19-
# $Id: admin.py,v 1.85.2.9 2005-07-05 06:28:35 richard Exp $
19+
# $Id: admin.py,v 1.85.2.10 2005-07-12 01:43:17 richard Exp $
2020

2121
'''Administration commands for maintaining Roundup trackers.
2222
'''
@@ -571,7 +571,7 @@ def do_get(self, args):
571571
return 0
572572

573573

574-
def do_set(self, args, pwre = re.compile(r'{(\w+)}(.+)')):
574+
def do_set(self, args):
575575
""'''Usage: set items property=value property=value ...
576576
Set the given properties of one or more items(s).
577577
@@ -732,7 +732,7 @@ def do_display(self, args):
732732
value = cl.get(nodeid, key)
733733
print _('%(key)s: %(value)r')%locals()
734734

735-
def do_create(self, args, pwre = re.compile(r'{(\w+)}(.+)')):
735+
def do_create(self, args):
736736
""'''Usage: create classname property=value ...
737737
Create a new entry of a given class.
738738

roundup/backends/back_anydbm.py

Lines changed: 2 additions & 3 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: back_anydbm.py,v 1.179.2.7 2005-03-03 22:12:35 richard Exp $
18+
#$Id: back_anydbm.py,v 1.179.2.8 2005-07-12 01:43:17 richard Exp $
1919
'''This module defines a backend that saves the hyperdatabase in a
2020
database chosen by anydbm. It is guaranteed to always be available in python
2121
versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several
@@ -1588,7 +1588,6 @@ def filter(self, search_matches, filterspec, sort=(None,None),
15881588
INTERVAL = 'spec:interval'
15891589
OTHER = 'spec:other'
15901590

1591-
timezone = self.db.getUserTimezone()
15921591
for k, v in filterspec.items():
15931592
propclass = props[k]
15941593
if isinstance(propclass, hyperdb.Link):
@@ -1619,7 +1618,7 @@ def filter(self, search_matches, filterspec, sort=(None,None),
16191618
l.append((STRING, k, re.compile(v, re.I)))
16201619
elif isinstance(propclass, hyperdb.Date):
16211620
try:
1622-
date_rng = date.Range(v, date.Date, offset=timezone)
1621+
date_rng = propclass.range_from_raw (v, self.db)
16231622
l.append((DATE, k, date_rng))
16241623
except ValueError:
16251624
# If range creation fails - ignore that search parameter

roundup/backends/back_metakit.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: back_metakit.py,v 1.88.2.5 2005-06-24 06:40:18 richard Exp $
1+
# $Id: back_metakit.py,v 1.88.2.6 2005-07-12 01:43:17 richard Exp $
22
'''Metakit backend for Roundup, originally by Gordon McMillan.
33
44
Known Current Bugs:
@@ -1209,8 +1209,6 @@ def filter(self, search_matches, filterspec, sort=(None,None),
12091209
if __debug__:
12101210
start_t = time.time()
12111211

1212-
timezone = self.db.getUserTimezone()
1213-
12141212
where = {'_isdel':0}
12151213
wherehigh = {}
12161214
mlcriteria = {}
@@ -1277,7 +1275,7 @@ def filter(self, search_matches, filterspec, sort=(None,None),
12771275
elif isinstance(prop, hyperdb.Date):
12781276
try:
12791277
# Try to filter on range of dates
1280-
date_rng = Range(value, date.Date, offset=timezone)
1278+
date_rng = prop.range_from_raw (value, self.db)
12811279
if date_rng.from_value:
12821280
t = date_rng.from_value.get_tuple()
12831281
where[propname] = int(calendar.timegm(t))

roundup/backends/back_mysql.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,6 @@ def filter(self, search_matches, filterspec, sort=(None,None),
520520

521521
cn = self.classname
522522

523-
timezone = self.db.getUserTimezone()
524-
525523
# vars to hold the components of the SQL statement
526524
frum = ['_'+cn] # FROM clauses
527525
loj = [] # LEFT OUTER JOIN clauses
@@ -616,7 +614,7 @@ def filter(self, search_matches, filterspec, sort=(None,None),
616614
else:
617615
try:
618616
# Try to filter on range of dates
619-
date_rng = Range(v, date.Date, offset=timezone)
617+
date_rng = propclass.range_from_raw (v, self.db)
620618
if date_rng.from_value:
621619
where.append('_%s._%s >= %s'%(cn, k, a))
622620
args.append(dc(date_rng.from_value))

roundup/backends/rdbms_common.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.142.2.9 2005-05-18 05:18:15 richard Exp $
1+
# $Id: rdbms_common.py,v 1.142.2.10 2005-07-12 01:43:17 richard Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -2051,8 +2051,6 @@ def filter(self, search_matches, filterspec, sort=(None,None),
20512051

20522052
cn = self.classname
20532053

2054-
timezone = self.db.getUserTimezone()
2055-
20562054
# vars to hold the components of the SQL statement
20572055
frum = [] # FROM clauses
20582056
loj = [] # LEFT OUTER JOIN clauses
@@ -2141,7 +2139,7 @@ def filter(self, search_matches, filterspec, sort=(None,None),
21412139
else:
21422140
try:
21432141
# Try to filter on range of dates
2144-
date_rng = Range(v, date.Date, offset=timezone)
2142+
date_rng = propclass.range_from_raw (v, self.db)
21452143
if date_rng.from_value:
21462144
where.append('_%s._%s >= %s'%(cn, k, a))
21472145
args.append(dc(date_rng.from_value))

roundup/cgi/templating.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,6 +1396,8 @@ def __init__(self, client, classname, nodeid, prop, name, value,
13961396
isinstance(self._value, unicode)):
13971397
self._value.setTranslator(self._client.translator)
13981398
self._offset = offset
1399+
if self._offset is None :
1400+
self._offset = self._prop.offset (self._db)
13991401

14001402
def plain(self):
14011403
''' Render a "plain" representation of the property
@@ -1480,8 +1482,11 @@ def field(self, size=30, default=None, format=_marker):
14801482
else:
14811483
value = date.Date(raw_value).pretty(format)
14821484
else:
1483-
tz = self._db.getUserTimezone()
1484-
value = raw_value.local(tz)
1485+
if self._offset is None :
1486+
offset = self._db.getUserTimezone()
1487+
else :
1488+
offset = self._offset
1489+
value = raw_value.local(offset)
14851490
if format is not self._marker:
14861491
value = value.pretty(format)
14871492

0 commit comments

Comments
 (0)