A better solution

2018-03-16 Thread Andrew Z
Hello, im not entirely happy with my solution and would love to hear your suggestions on how to improve the solution. I simplified the task while keeping the code working. Task: financial accounts are described by XML documents. I want to architecture the code to be easily extendible ( easy to

Re: From logging to files to a better solution: syslog, Sentry, Logstash, ....

2015-09-16 Thread Thomas Güttler
Am Mittwoch, 16. September 2015 07:58:11 UTC+2 schrieb dieter: > Thomas Güttler writes: > > Am Freitag, 11. September 2015 11:03:52 UTC+2 schrieb jmp: > > ... > >> Something like (python 2.7) > >> > >> import logging > >> > >> logCfg = { > >> 'remote':( > >> logging.StreamHandler()

Re: From logging to files to a better solution: syslog, Sentry, Logstash, ....

2015-09-15 Thread dieter
Thomas Güttler writes: > Am Freitag, 11. September 2015 11:03:52 UTC+2 schrieb jmp: > ... >> Something like (python 2.7) >> >> import logging >> >> logCfg = { >> 'remote':( >> logging.StreamHandler(), >> logging.Formatter('Remote - %(levelname)s - %(message)s'), >>

Re: From logging to files to a better solution: syslog, Sentry, Logstash, ....

2015-09-15 Thread jmp
On 09/15/2015 11:35 AM, Thomas Güttler wrote: Yes, I could do it this way. But somehow I am not happy with this solution. I think the filtering should be outside of python. [snip] Can you understand my concerns? Thomas Güttler No, not really. I showed you how it can be done in p

Re: From logging to files to a better solution: syslog, Sentry, Logstash, ....

2015-09-15 Thread Thomas Güttler
Am Freitag, 11. September 2015 10:18:11 UTC+2 schrieb marco@colosso.nl: > On Friday, September 11, 2015 at 9:22:42 AM UTC+2, Thomas Güttler wrote: > > Am Donnerstag, 10. September 2015 08:42:47 UTC+2 schrieb dieter: > > > Thomas Güttler writes: > > > > ... > > > > Why we are unhappy with loggin

Re: From logging to files to a better solution: syslog, Sentry, Logstash, ....

2015-09-15 Thread Thomas Güttler
Am Freitag, 11. September 2015 11:03:52 UTC+2 schrieb jmp: > On 09/11/2015 09:22 AM, Thomas Güttler wrote: > > > > I want INFO to be logged and stored on the remote host. > > Therefore I must not filter INFO messages. > > > > I don't want to pull INFO messages over the VPN. > > > > Ergo, the filter

Re: From logging to files to a better solution: syslog, Sentry, Logstash, ....

2015-09-11 Thread dieter
Thomas Güttler writes: > Am Donnerstag, 10. September 2015 08:42:47 UTC+2 schrieb dieter: >> Thomas Güttler writes: >> > ... >> > Why we are unhappy with logging to files: >> > >> > - filtering: We don't want to get INFO messages over the VPN. >> >> You can quite easily control at what level me

Re: From logging to files to a better solution: syslog, Sentry, Logstash, ....

2015-09-11 Thread jmp
On 09/11/2015 09:22 AM, Thomas Güttler wrote: I want INFO to be logged and stored on the remote host. Therefore I must not filter INFO messages. I don't want to pull INFO messages over the VPN. Ergo, the filtering at Python level does not help in my use case. Or I am missing something. Proba

Re: From logging to files to a better solution: syslog, Sentry, Logstash, ....

2015-09-11 Thread marco . nawijn
On Friday, September 11, 2015 at 9:22:42 AM UTC+2, Thomas Güttler wrote: > Am Donnerstag, 10. September 2015 08:42:47 UTC+2 schrieb dieter: > > Thomas Güttler writes: > > > ... > > > Why we are unhappy with logging to files: > > > > > > - filtering: We don't want to get INFO messages over the VPN.

Re: From logging to files to a better solution: syslog, Sentry, Logstash, ....

2015-09-11 Thread Thomas Güttler
Am Donnerstag, 10. September 2015 08:42:47 UTC+2 schrieb dieter: > Thomas Güttler writes: > > ... > > Why we are unhappy with logging to files: > > > > - filtering: We don't want to get INFO messages over the VPN. > > You can quite easily control at what level messages are logged with > the stand

Re: From logging to files to a better solution: syslog, Sentry, Logstash, ....

2015-09-09 Thread dieter
Thomas Güttler writes: > ... > Why we are unhappy with logging to files: > > - filtering: We don't want to get INFO messages over the VPN. You can quite easily control at what level messages are logged with the standard Python logging framework. Each handler has a level and will ignore messages

From logging to files to a better solution: syslog, Sentry, Logstash, ....

2015-09-09 Thread Thomas Güttler
Up to now we use simple logging to files. We don't use syslog or an other server based solution. I am unsure which architecture works for our environment. Our environment: - django based applications - a lot of batch/cron jobs (non web gui) processing - One linux server runs several systems.

Re: Returning a value from exec or a better solution

2011-08-31 Thread Ian Kelly
On Wed, Aug 31, 2011 at 12:35 AM, Arnaud Delobelle wrote: >> You don't know that, an implementation may for example set __bultins__ >> to None, prior to returning, its not an unreasonable thing to do and >> the docs don't say they can't. > > I haven't studied the docs but I'm certain that such an

Re: Returning a value from exec or a better solution

2011-08-30 Thread Arnaud Delobelle
On 30 August 2011 22:48, Rob Williscroft wrote: > Arnaud Delobelle wrote in > news:CAJ6cK1YVi3NQgdZOUdhAESf133pUkdazM1PkSP=p6xfayvo...@mail.gmail.com in > gmane.comp.python.general: > >> On 30 August 2011 13:31, Jack Trades wrote: >>> >>> >>> On Tue, Aug 30, 2011 at 2:37 AM, Rob Williscroft wrot

Re: Returning a value from exec or a better solution

2011-08-30 Thread Jack Trades
On Tue, Aug 30, 2011 at 1:19 PM, Ethan Furman wrote: > > I spoke a bit too soon with the "works flawlessly" post. In addition to >> your issue, there is also the problem that supplying an empty environment >> does not allow the user to call necessary functions (like scheme_eval). >> > > > So, ju

Re: Returning a value from exec or a better solution

2011-08-30 Thread Ethan Furman
Rob Williscroft wrote: Arnaud Delobelle wrote: That's not an issue. The last statement that is executed will be the "def" statement. You don't know that, an implementation may for example set __bultins__ to None, prior to returning, its not an unreasonable thing to do and the docs don't say

Re: Returning a value from exec or a better solution

2011-08-30 Thread Ethan Furman
Rob Williscroft wrote: Arnaud Delobelle wrote: That's not an issue. The last statement that is executed will be the "def" statement. You don't know that, an implementation may for example set __bultins__ to None, prior to returning, its not an unreasonable thing to do and the docs don't say

Re: Returning a value from exec or a better solution

2011-08-30 Thread Rob Williscroft
Arnaud Delobelle wrote in news:CAJ6cK1YVi3NQgdZOUdhAESf133pUkdazM1PkSP=p6xfayvo...@mail.gmail.com in gmane.comp.python.general: > On 30 August 2011 13:31, Jack Trades wrote: >> >> >> On Tue, Aug 30, 2011 at 2:37 AM, Rob Williscroft wrote: >> >>> >>> > That's brilliant and works flawlessly. ¶ÿT

Re: Returning a value from exec or a better solution

2011-08-30 Thread Arnaud Delobelle
On 30 August 2011 13:31, Jack Trades wrote: > > > On Tue, Aug 30, 2011 at 2:37 AM, Rob Williscroft wrote: > >> >> > That's brilliant and works flawlessly.  Thank you very much! >> >> If an impementation (as you say up thread) can populate globals >> or locals with whatever they want, then how do

Re: Returning a value from exec or a better solution

2011-08-30 Thread Ethan Furman
Rob Williscroft wrote: Ethan Furman wrote in news:4e5d29c8.8010...@stoneleaf.us in gmane.comp.python.general: Jack Trades wrote: On Tue, Aug 30, 2011 at 2:37 AM, Rob Williscroft wrote: If an impementation (as you say up thread) can populate globals or locals with whatever they want, then how

Re: Returning a value from exec or a better solution

2011-08-30 Thread Rob Williscroft
Ethan Furman wrote in news:4e5d29c8.8010...@stoneleaf.us in gmane.comp.python.general: > Jack Trades wrote: >> On Tue, Aug 30, 2011 at 2:37 AM, Rob Williscroft wrote: >>> If an impementation (as you say up thread) can populate globals >>> or locals with whatever they want, then how do you know th

Re: Returning a value from exec or a better solution

2011-08-30 Thread Ethan Furman
Jack Trades wrote: On Tue, Aug 30, 2011 at 2:37 AM, Rob Williscroft wrote: If an impementation (as you say up thread) can populate globals or locals with whatever they want, then how do you know that last item added was the function definition the user supplied ? Because the implementation wil

Re: Returning a value from exec or a better solution

2011-08-30 Thread Jack Trades
On Tue, Aug 30, 2011 at 2:37 AM, Rob Williscroft wrote: > > That's brilliant and works flawlessly. Thank you very much! > > If an impementation (as you say up thread) can populate globals > or locals with whatever they want, then how do you know that last > item added was the function definitio

Re: Returning a value from exec or a better solution

2011-08-30 Thread Rob Williscroft
Jack Trades wrote in news:CAG5udOiOAge3uHrGSDTZ412GAg+CC- 6u8igoyj0lnf3hnwu...@mail.gmail.com in gmane.comp.python.general: >> >>> class CapturingDict(dict): >> ... def __setitem__(self, key, val): >> ... self.key, self.val = key, val >> ... dict.__setitem__(self, key, val) >>

Re: Returning a value from exec or a better solution

2011-08-30 Thread Rob Williscroft
Jack Trades wrote in news:CAG5udOh1+oE4g9Frjp3pucbHUtWcN34KK35a-Xs2YqkZH9X5=w...@mail.gmail.com in gmane.comp.python.general: >> def test(): >> src = ( >> "def double(x):" >> " return x * 2" >> ) >> globals = {} >> exec( src, globals ) >> return globals[ "double" ] >> >> prin

Re: Returning a value from exec or a better solution

2011-08-29 Thread Jack Trades
On Mon, Aug 29, 2011 at 5:50 PM, Arnaud Delobelle wrote: > > Hi Jack, > > Here is a possible solution for your problem (Python 3): > > > >>> class CapturingDict(dict): > ... def __setitem__(self, key, val): > ... self.key, self.val = key, val > ... dict.__setitem__(self, key,

Re: Returning a value from exec or a better solution

2011-08-29 Thread Arnaud Delobelle
On 29 August 2011 23:14, Jack Trades wrote: > On Mon, Aug 29, 2011 at 12:30 PM, Rob Williscroft wrote: >> >> Jack Trades wrote in >> > ... I wanted to allow the user to manually return the >> > function from the string, like this: >> > >> > a = exec(""" >> > def double(x): >> >   return x * 2 >>

Re: Returning a value from exec or a better solution

2011-08-29 Thread Jack Trades
On Mon, Aug 29, 2011 at 12:30 PM, Rob Williscroft wrote: > Jack Trades wrote in > > ... I wanted to allow the user to manually return the > > function from the string, like this: > > > > a = exec(""" > > def double(x): > > return x * 2 > > double > > """) > > > > However it seems that exec does

Re: Returning a value from exec or a better solution

2011-08-29 Thread Rob Williscroft
Jack Trades wrote in news:CAG5udOg=GtFGPmTB=1ojnvnrpdyucxdokn1wjqmomv9gx0+...@mail.gmail.com in gmane.comp.python.general: > ... I wanted to allow the user to manually return the > function from the string, like this: > > a = exec(""" > def double(x): > return x * 2 > double > """) > > Howeve

Returning a value from exec or a better solution

2011-08-29 Thread Jack Trades
I'm writing a Scheme interpreter and I need to be able to create and return a Python function from a string. This is a port of another Scheme interpreter I wrote in Scheme. What I'm trying to do looked like this: (define (scheme-syntax expr) (hash-table-set! global-syntax (car expr) (eval (cad

Re: how to create a pointer, or is there a better solution ?

2007-10-13 Thread Diez B. Roggisch
stef mientki schrieb: > hello, > > I've a program where users can make modules, > by just dumping them in a certain directory, > then they will dynamically link into the program if needed. > > One of the communication channels I use, > is a general global file, which should be imported by all use

how to create a pointer, or is there a better solution ?

2007-10-13 Thread stef mientki
hello, I've a program where users can make modules, by just dumping them in a certain directory, then they will dynamically link into the program if needed. One of the communication channels I use, is a general global file, which should be imported by all user modules. One of the things a user s

Re: a better solution for GUI in python

2007-03-17 Thread Rainer Grimm
ce wrote: > Hi, > > My company is using python currently for our website. We need to > develop a GUI front-end for our ERP that would be portable (Windows > and Linux). > > My question is which solution would be better for the GUI (and easier > to implement)? I knew there are something like wxidg

Re: a better solution for GUI in python

2007-03-12 Thread Chris Mellon
On 3/12/07, David Boddie <[EMAIL PROTECTED]> wrote: > On Monday 12 March 2007 16:57, Chris Mellon wrote: > > > Gtk I consider an extremely poor contender as a cross platform > > toolkit. The runtime is enormous and it makes little effort to appear > > native on any non-GNOME platform. > > Given tha

Re: a better solution for GUI in python

2007-03-12 Thread David Boddie
On Monday 12 March 2007 16:57, Chris Mellon wrote: > Gtk I consider an extremely poor contender as a cross platform > toolkit. The runtime is enormous and it makes little effort to appear > native on any non-GNOME platform. Given that wxPython more or less relies on GTK+ on Linux, I think you're

Re: a better solution for GUI in python

2007-03-12 Thread Chris Mellon
On 3/11/07, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Bjoern Schliessmann napisał(a): > > >> I'd recommend pyGTK. It's easy to use, delivers astonishing > >> results and is perfectly portable as far as I know. > > > > And how does it look on Windows? :) > > On styled Windows XP it looks like any oth

Re: a better solution for GUI in python

2007-03-11 Thread ici
On Mar 11, 1:03 pm, "ce" <[EMAIL PROTECTED]> wrote: > Hi, > > My company is using python currently for our website. We need to > develop a GUI front-end for our ERP that would be portable (Windows > and Linux). > > My question is which solution would be better for the GUI (and easier > to implement

Re: a better solution for GUI in python

2007-03-11 Thread Uwe Grauer
ce wrote: > Hi, > > My company is using python currently for our website. We need to > develop a GUI front-end for our ERP that would be portable (Windows > and Linux). > > My question is which solution would be better for the GUI (and easier > to implement)? I knew there are something like wxidg

Re: a better solution for GUI in python

2007-03-11 Thread Casey Hawthorne
For a browser interface have you thought of Ajax and possibly WPF/E? http://en.wikipedia.org/wiki/AJAX http://en.wikipedia.org/wiki/Windows_Presentation_Foundation -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: a better solution for GUI in python

2007-03-11 Thread Jarek Zgoda
Bjoern Schliessmann napisał(a): >> I'd recommend pyGTK. It's easy to use, delivers astonishing >> results and is perfectly portable as far as I know. > > And how does it look on Windows? :) On styled Windows XP it looks like any other styled application (counting those Qt and wx based). On Win

Re: a better solution for GUI in python

2007-03-11 Thread ce
On Mar 11, 3:05 pm, Paul Rubin wrote: > "ce" <[EMAIL PROTECTED]> writes: > > My company is using python currently for our website. We need to > > develop a GUI front-end for our ERP that would be portable (Windows > > and Linux). > > Some reason not to use a browser inter

Re: a better solution for GUI in python

2007-03-11 Thread Bjoern Schliessmann
StD wrote: > I'd recommend pyGTK. It's easy to use, delivers astonishing > results and is perfectly portable as far as I know. And how does it look on Windows? :) > I'm working with it myself, having the goal of simplicity as well > as portability and I got to say, it works! Hope that was helpf

Re: a better solution for GUI in python

2007-03-11 Thread Bjoern Schliessmann
ce wrote: > My question is which solution would be better for the GUI (and > easier to implement)? I knew there are something like wxidgets, (wxWidgets. It's the C++ lib, its Python bindings are wxPython) > QT (same as above, it's called pyQt. Check licensing, it's not as liberal as the others'

Re: a better solution for GUI in python

2007-03-11 Thread Paul Rubin
"ce" <[EMAIL PROTECTED]> writes: > My company is using python currently for our website. We need to > develop a GUI front-end for our ERP that would be portable (Windows > and Linux). Some reason not to use a browser interface instead of a client gui? -- http://mail.python.org/mailman/listinfo/py

Re: a better solution for GUI in python

2007-03-11 Thread StD
On 11 Mrz., 12:03, "ce" <[EMAIL PROTECTED]> wrote: > Hi, > > My company is using python currently for our website. We need to > develop a GUI front-end for our ERP that would be portable (Windows > and Linux). > > My question is which solution would be better for the GUI (and easier > to implement)

a better solution for GUI in python

2007-03-11 Thread ce
Hi, My company is using python currently for our website. We need to develop a GUI front-end for our ERP that would be portable (Windows and Linux). My question is which solution would be better for the GUI (and easier to implement)? I knew there are something like wxidgets, QT and pyGTK? actuall