IRC logs of #tryton for Friday, 2012-05-11

chat.freenode.net #tryton log beginning Fri May 11 00:00:01 CEST 2012
2012-05-11 14:49 <sisalp> hello, python for dumbs : I write a script and I want to provide a OK/NOK status at the end. Is it "return xxx" where xxx contains 0 or not ?
2012-05-11 14:52 <udono> sisalp: Hi, I do not understand the question.
2012-05-11 14:54 <sisalp> sys.exit(n). n==0
2012-05-11 14:54 <sisalp> means success, n!=0 means fail. is that correct ?
2012-05-11 14:55 <udono> sisalp: AFAIK: correct
2012-05-11 14:56 <nicoe> sisalp: you're right
2012-05-11 14:59 <bechamel> sisalp: (from the doc) you can also do sys.exit('error msg') and it will print the error and exit status will be 1
2012-05-11 15:00 <sisalp> bechamel: thank you.
2012-05-11 15:01 <sisalp> bechamel: more and more stupid question : where do you read the doc from ?
2012-05-11 15:03 <bechamel> sisalp: I launch a python shell and then call "help(sys.exit)"
2012-05-11 15:05 <sisalp> bechamel: thank you so much ;-)
2012-05-11 15:06 <nicoe> http://docs.python.org also
2012-05-11 15:09 <bechamel> ACTION thinks his solution is quicker :)
2012-05-11 15:11 <nicoe> bechamel: you have to already know what you're searching
2012-05-11 15:12 <udono> another one from shell: pydoc sys.exit
2012-05-11 15:12 <bechamel> udono: nice!
2012-05-11 15:16 <sisalp> nocoe: this one is high class ! http://docs.python.org/library/sys.html?highlight=sys.exit#sys.exit
2012-05-11 15:26 <__efx__> hello, I need to write a method (server side) that is executed when a user opens the editting window of a party, can I do that ?
2012-05-11 15:29 <nicoe> __efx__: no
2012-05-11 15:30 <nicoe> __efx__: why do you want to do that ?
2012-05-11 15:31 <__efx__> because I want to save in a file the last time this party has been edited
2012-05-11 15:32 <bechamel> __efx__: just override the write method
2012-05-11 15:33 <__efx__> bechamel: thank you ! but will this work if I want to save the last time the party has been accessed
2012-05-11 15:33 <__efx__> ?
2012-05-11 15:34 <bechamel> __efx__: for the last access, you can override the read method
2012-05-11 15:34 <nicoe> the last time the party has been edited is already stored, no need to override the write method
2012-05-11 15:35 <nicoe> __efx__: but be aware that every read will impact this ! Moreover some transactions a readonly thus your read will probably fail
2012-05-11 15:37 <bechamel> nicoe: ".. in a file .."
2012-05-11 15:38 <nicoe> ok misread
2012-05-11 15:38 <nicoe> Anyway you will have a concurency issue because you will need a lock to write on the file
2012-05-11 15:40 <__efx__> a lock ?
2012-05-11 15:41 <bechamel> nicoe: there is already a lock, it is called the GIL :), joke aside I'm not sure a the file can get inconsitent if several threads write in it
2012-05-11 15:42 <bechamel> __efx__: anyway, I wonder why you want to write in a file while you have already a db to do it
2012-05-11 15:42 <nicoe> __efx__: https://en.wikipedia.org/wiki/Lock_(computer_science)
2012-05-11 15:43 <__efx__> because I dont want to need user / pass to access this info
2012-05-11 15:43 <__efx__> i mean not the user / pass of tryton
2012-05-11 15:45 <bechamel> __efx__: and what about simply logging it to the log file ?
2012-05-11 15:47 <__efx__> if I do that, I will spent time parsing the log file to find the info, unless I can write to different log file
2012-05-11 15:47 <__efx__> ?
2012-05-11 15:47 <pilou> maybe you could use a dedicated role which can only read party ?
2012-05-11 15:48 <nicoe> In fact why do you want to track reads by people that are authorized to do them ?
2012-05-11 15:49 <nicoe> It seems strange to me
2012-05-11 15:50 <__efx__> that's for synchronisation purpose
2012-05-11 15:50 <__efx__> I have two different trytond server and I want to communicate between them
2012-05-11 15:51 <__efx__> however I want to start the communication only if needed
2012-05-11 15:51 <bechamel> nicoe: useful in medical application: if you block people from reading info from the system you may put lifes in danger. But you also want to avoid the user spying their colleagues, so you must monitor the access and try to find abnormal behaviours
2012-05-11 15:52 <sisalp> __efx__: so what is the file for ?
2012-05-11 15:54 <__efx__> the file is there to tell a tryton server if he has to initiate a communication or not
2012-05-11 15:55 <bechamel> __efx__: so you only need to know last writes, and not last reads
2012-05-11 15:55 <bechamel> ?
2012-05-11 15:56 <__efx__> yes sure, but I need to rewrite both methods
2012-05-11 15:58 <bechamel> __efx__: if you really want a file, what about a external script that read the db (or do a remote call to the tryton server) and generate it ?
2012-05-11 16:01 <__efx__> actually in one side I will do that through proteus because I will be on a django app
2012-05-11 17:03 <lukio> hello everybody, where are the mercurial repos of the modules?
2012-05-11 17:10 <bechamel> lukio: http://hg.tryton.org/modules
2012-05-11 17:10 <bechamel> or http://hg.tryton.org/2.4/modules for stable ones
2012-05-11 17:17 <lukio> bechamel, thanks!
2012-05-11 17:20 <bechamel> lukio: this may help http://code.google.com/p/tryton/wiki/InstallationMercurial
2012-05-11 17:23 <lukio> oops, i didn't read ** repositories for the modules, one for each module, prefixed by module/ **
2012-05-11 17:57 -!- Mayank(~mayank@122.162.5.15) has left #tryton
2012-05-11 19:02 -!- ciupicri(~ciupicri@unaffiliated/ciupicri) has left #tryton
2012-05-11 21:42 -!- lukio(~lukio@186.23.122.88) has left #tryton

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!