Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Trac: Users

Dates & XML RPC plugin ... missing tickets changes

 

 

Trac users RSS feed   Index | Next | Previous | View Threaded


olemis at gmail

May 5, 2009, 2:03 PM

Post #1 of 4 (496 views)
Permalink
Dates & XML RPC plugin ... missing tickets changes

Hello I've experienced some issues while using XMLRPC plugin to
retrieve ticket changes. See below for further details (Thnx in
advance ;):

olemis To be more precise about the issue at hand
olemis I have the following changes

16:03 olemis 2 new Date(2009,4,3,8,19,25) 'olemis' 'comment' '1' 'My
extremely useful comment' true
olemis 2 new Date(2009,4,4,1,52,46) 'olemis' 'attachment' '' 'aaa.sql' false
olemis 2 new Date(2009,4,4,1,52,46) 'olemis' 'comment' '' 'AAaaaaaaa' false
olemis 2 new Date(2009,4,4,1,53,9) 'olemis' 'attachment' '' 'aaa.prj' false
olemis 2 new Date(2009,4,4,1,53,9) 'olemis' 'comment' '' 'Initialize
me baby !' false
olemis pay attention to the info inside `new Date()`
olemis and

16:07 olemis and the following code snippet should return something at
least last four rows
olemis >>> p
olemis <ServerProxy for 172.18.2.148:8000/trac-dev/xmlrpc>
olemis >>> dt = datetime(2009,5,4,1,52,43)
olemis >>> dtv = DateTime(dt)
olemis >>> p.ticket.getRecentChanges(dtv)
olemis []

olemis but doesnt
16:08 retracile olemis: I notice the month is 4 above, but 5 in your
later stuff....

16:09 olemis That's because javascript months start at 0 and datetime's at 1
olemis this is explicitly handled by gviz_api module when a DataTable
is built oiut of its values
olemis retracile: both months are may (above for JS, below for datetime)

16:12 retracile olemis: ok

16:16 thatch olemis: let me understand... the returned datetime
objects are in your user's timezone, but the since parameter for
getRecentChanges is being interpreted as UTC?

16:17 olemis That's the thing ... I am not sure about the coordinates
for these values
olemis so I dont know which one is utc and which one is local

16:18 olemis However my Trac env uses tz -5:00 GMT

16:19 olemis and I also tried
olemis >>> p.ticket.getRecentChanges(DateTime(datetime(2009,5,3,9,52,43)))
olemis []

16:20 olemis The difference is almost one day
olemis and no changes

olemis Guys why is it that TicketRPC.changeLog doesnot accept neither
datetime objs nor instances of DateTime ?

olemis It gives me the following error : cannot marshal <type
'generator'> objects' while executing 'ticket.changeLog()'

olemis I'm talking about `since` param

thatch olemis: I don't think any of us have lots of experience with
the xmlrpc plugin. ping coderanger when he's back if you have specific
questions.

--
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
Here comes the Sun ... turu ruru. It's Oracle's ! -
http://feedproxy.google.com/~r/simelo-es/~3/EMxV1KHhl60/here-comes-sun-turu-ruru-its-oracles.html

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


olemis at gmail

May 7, 2009, 10:14 AM

Post #2 of 4 (455 views)
Permalink
Re: Dates & XML RPC plugin ... missing tickets changes [In reply to]

On Tue, May 5, 2009 at 4:03 PM, Olemis Lang <olemis [at] gmail> wrote:
> Hello I've experienced some issues while using XMLRPC plugin to
> retrieve ticket changes.


Well yesterday it was late at night and I discovered something crucial.
It spins me right round and enlightened me a bit (a friend of mine
told me that was the moon, but I'm smarter, I didnt believe him ...
XD).

Let's take a look at the datetime values once again :

2 new Date(2009,4,3,8,19,25) 'olemis' 'comment' '1' 'My extremely
useful comment' true
2 new Date(2009,4,4,1,52,46) 'olemis' 'attachment' '' 'aaa.sql' false
2 new Date(2009,4,4,1,52,46) 'olemis' 'comment' '' 'AAaaaaaaa' false
2 new Date(2009,4,4,1,53,9) 'olemis' 'attachment' '' 'aaa.prj' false
2 new Date(2009,4,4,1,53,9) 'olemis' 'comment' '' 'Initialize me baby !' false

In this case :

{{{
>>> from xmlrpclib import ServerProxy
>>> p = ServerProxy('http://localhost:8000/trac-dev/xmlrpc')
>>> from datetime import datetime
>>> p.ticket.getRecentChanges(datetime(2009,5,3,8,19,26))
[]
>>> p.ticket.getRecentChanges(datetime(2009,5,3,8,19,25))
[2]
>>>
>>> p.ticket.changeLog(2, datetime(2009,5,3,8,19,25))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files\Python\2.5\lib\xmlrpclib.py", line 1147, in __call__
return self.__send(self.__name, args)
File "C:\Program Files\Python\2.5\lib\xmlrpclib.py", line 1437, in __request
verbose=self.__verbose
File "C:\Program Files\Python\2.5\lib\xmlrpclib.py", line 1201, in request
return self._parse_response(h.getfile(), sock)
File "C:\Program Files\Python\2.5\lib\xmlrpclib.py", line 1340, in
_parse_response
return u.close()
File "C:\Program Files\Python\2.5\lib\xmlrpclib.py", line 787, in close
raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 2: "'cannot marshal <type 'generator'>
objects' while executing 'ticket.changeLog()'">
}}}

considering that :

{{{
#! python

# @tracrpc.ticket.TicketRPC

def getRecentChanges(self, req, since):
"""Returns a list of IDs of tickets that have changed since
timestamp."""
since = to_timestamp(since)
db = self.env.get_db_cnx()
cursor = db.cursor()
cursor.execute('SELECT id FROM ticket'
' WHERE changetime >= %s', (since,))
result = []
for row in cursor:
result.append(int(row[0]))
return result
}}}

My conclusions :

- It seems that once a «collateral change that is not yet immutable»
(i.e. permanent=false as returned by
tracrpc.ticket.TicketRPC.changeLog) is made then Trac doesnt update
changetime column in the BD (tickets).
- That's why the first call to getRecentChanges above returns an
empty list, even if there are more recent changes.

My Qs :

- Is this statement true ? Is this behavior Ok ? IMHO & a-priori it
shouldnt be so.
- What about the traceback in p.ticket.changeLog ? Is it ok too ?
- How can I (reliably) get all the changes made to tickets since a
(well-known) date in the past, plus the tickets involved ? I would not like
to go directly to the DB, since I'm planning (in the future, Mr
Vader agreed in helping me, I just have to help him to conquer
the world ... bah! piece of cake !) to get rid of all the
relational SQL queries out there and use an ORM or something OO
instead.


Thnx in advance ;o)

--
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
Here comes the Sun ... turu ruru. It's Oracle's ! -
http://feedproxy.google.com/~r/simelo-es/~3/EMxV1KHhl60/here-comes-sun-turu-ruru-its-oracles.html

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


olemis at gmail

May 11, 2009, 9:01 AM

Post #3 of 4 (424 views)
Permalink
Re: Dates & XML RPC plugin ... missing tickets changes [In reply to]

On Thu, May 7, 2009 at 12:14 PM, Olemis Lang <olemis [at] gmail> wrote:
> On Tue, May 5, 2009 at 4:03 PM, Olemis Lang <olemis [at] gmail> wrote:
>> Hello I've experienced some issues while using XMLRPC plugin to
>> retrieve ticket changes.
>

Further research (please read the whole thread for previous work being done) :

Here I go again ... After all this I tried another approach. This
time I used timeline module and underlying interfaces in order to
retrieve ticket's (and further) changes. However, this time I found
that the action of attaching a file to a ticket is not reported as a
timed event, as opposite to wiki filter which reports'em (and
attachments module has support for this too ... it's some kind of
'meta' event provider).

Is it the way it happens or an odd behavior? Should it be like this ?
IMHO & a-priori, I dont think so. I think that all the changes
reported by `TicketRPC.changeLog` should also be included in the
timeline. Isn't it ?

Anyway, I keep waiting for any reply in order to move on and release
TracGViz 1.3.1. This is one of the main blocker I have so far, and
very soon it will be the only one :( ...

Should I use the issue tracker and file a (some) ticket(s) ?

In the mean time I'm waiting right here ... «enjoying the silence» ...

--
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


olemis at gmail

Jul 6, 2009, 7:09 AM

Post #4 of 4 (315 views)
Permalink
Re: Dates & XML RPC plugin ... missing tickets changes [In reply to]

On Thu, May 7, 2009 at 12:14 PM, Olemis Lang<olemis [at] gmail> wrote:
> On Tue, May 5, 2009 at 4:03 PM, Olemis Lang <olemis [at] gmail> wrote:
>

JFYI

>
> - How can I (reliably) get all the changes made to tickets since a
>  (well-known) date in the past, plus the tickets involved ?
>

Answer :

- Use Ticket timeline provider and set timeline.ticket_show_details =
true in trac.ini .


--
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
Here comes the Sun ... turu ruru. It's Oracle's !  -
http://feedproxy.google.com/~r/simelo-es/~3/EMxV1KHhl60/here-comes-sun-turu-ruru-its-oracles.html

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Trac users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.