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

chat.freenode.net #tryton log beginning Fri May 11 00:00:01 CEST 2012
sisalphello, 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  ?14:49
udonosisalp: Hi, I do not understand the question.14:52
sisalpsys.exit(n).  n==014:54
sisalpmeans success, n!=0 means fail. is that correct ?14:54
udonosisalp: AFAIK: correct14:55
nicoesisalp: you're right14:56
bechamelsisalp: (from the doc) you can also do sys.exit('error msg') and it will print the error and exit status will be 114:59
sisalpbechamel: thank you.15:00
sisalpbechamel: more and more stupid question : where do you read the doc from ?15:01
bechamelsisalp: I launch a python shell and then call "help(sys.exit)"15:03
sisalpbechamel: thank you so much ;-)15:05
nicoehttp://docs.python.org also15:06
bechamelACTION thinks his solution is quicker :)15:09
nicoebechamel: you have to already know what you're searching15:11
udonoanother one from shell: pydoc sys.exit15:12
bechameludono: nice!15:12
sisalpnocoe: this one is high class ! http://docs.python.org/library/sys.html?highlight=sys.exit#sys.exit15:16
__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 ?15:26
nicoe__efx__: no15:29
nicoe__efx__: why do you want to do that ?15:30
__efx__because I want to save in a file the last time this party has been edited15:31
bechamel__efx__: just override the write method15:32
__efx__bechamel: thank you ! but will this work if I want to save the last time the party has been accessed15:33
__efx__?15:33
bechamel__efx__: for the last access, you can override the read method15:34
nicoethe last time the party has been edited is already stored, no need to override the write method15:34
nicoe__efx__: but be aware that every read will impact this ! Moreover some transactions a readonly thus your read will probably fail15:35
bechamelnicoe: ".. in a file .."15:37
nicoeok misread15:38
nicoeAnyway you will have a concurency issue because you will need a lock to write on the file15:38
__efx__a lock ?15:40
bechamelnicoe: 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 it15:41
bechamel__efx__: anyway, I wonder why you want to write in a file while you have already a db to do it15:42
nicoe__efx__: https://en.wikipedia.org/wiki/Lock_(computer_science)15:42
__efx__because I dont want to need user / pass to access this info15:43
__efx__i mean not the user / pass of tryton15:43
bechamel__efx__: and what about simply logging it to the log file ?15:45
__efx__if I do that, I will spent time parsing the log file to find the info, unless I can write to different log file15:47
__efx__?15:47
piloumaybe you could use a dedicated role which can only read party ?15:47
nicoeIn fact why do you want to track reads by people that are authorized to do them ?15:48
nicoeIt seems strange to me15:49
__efx__that's for synchronisation purpose15:50
__efx__I have two different trytond server and I want to communicate between them15:50
__efx__however I want to start the communication only if needed15:51
bechamelnicoe: 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 behaviours15:51
sisalp__efx__: so what is the file for ?15:52
__efx__the file is there to tell a tryton server if he has to initiate a communication or not15:54
bechamel__efx__: so you only need to know last writes, and not last reads15:55
bechamel?15:55
__efx__yes sure, but I need to rewrite both methods15:56
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 ?15:58
__efx__actually in one side I will do that through proteus because I will be on a django app16:01
lukiohello everybody, where are the mercurial repos of the modules?17:03
bechamellukio: http://hg.tryton.org/modules17:10
bechamelor http://hg.tryton.org/2.4/modules for stable ones17:10
lukiobechamel, thanks!17:17
bechamellukio: this may help http://code.google.com/p/tryton/wiki/InstallationMercurial17:20
lukiooops, i didn't read ** repositories for the modules, one for each module, prefixed by module/  **17:23
-!- Mayank(~mayank@122.162.5.15) has left #tryton17:57
-!- ciupicri(~ciupicri@unaffiliated/ciupicri) has left #tryton19:02
-!- lukio(~lukio@186.23.122.88) has left #tryton21:42

Generated by irclog2html.py 2.11.0 by Marius Gedminas - find it at mg.pov.lt!