Recommended format for --log-level option

2018-09-24 Thread Victor Porton
What is the recommended format for --log-level (or --loglevel?) command line option? Is it a number or NOTSET|DEBUG|INFO|WARNING|ERROR|CRITICAL? Or should I accept both numbers and these string constants? -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo

What is more Pythonic: subclass or adding functionality to base class?

2018-02-11 Thread Victor Porton
e objects of this class. What is more pythonic? 1. Create its subclass PredicateParserWithError and add the additional field on_error to this class. 2. Add on_error field to the base class, setting it to None by default, if the class's user does not need this field. -- Victor Porton

Re: $srcdir and $datadir

2018-02-10 Thread Victor Porton
First, I've already solved my problem using setuptools and pkg_resources.resource_stream() and an environment variable to specify the path to data files. Ben Finney wrote: > Victor Porton writes: > >> In GNU software written in C $srcdir and $datadir are accessible to

$srcdir and $datadir

2018-02-08 Thread Victor Porton
In GNU software written in C $srcdir and $datadir are accessible to C code through generated config.h file. What is the right way to config directories for a Python program? -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list

Re: Dependency injection: overriding defaults

2018-02-01 Thread Victor Porton
dieter wrote: > Victor Porton writes: > >> I am writing a library, a command line utility which uses the library, >> and a I am going to use dependency_injector package. >> >> Consider loggers: >> >> For the core library the logger should default to

Re: Object-oriented gettext

2018-01-31 Thread Victor Porton
Victor Porton wrote: > I want to write a multiuser application which uses multiple languages (one > language for logging and a language per user). > > https://docs.python.org/3/library/gettext.html describes a procedural > gettext interface. The language needs to be switched befo

Advice on where to define dependency injection providers

2018-01-31 Thread Victor Porton
ecution_context_build, or maybe in something like xmlboiler.core.providers.execution_context? -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list

Object-oriented gettext

2018-01-31 Thread Victor Porton
above example). What is the best way to do this? Should I write an object-oriented wrapper around gettext package? -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list

Dependency injection: overriding defaults

2018-01-31 Thread Victor Porton
library. For the server, the log should go to a file (not to stderr). Question: How to profoundly make my software to use the appropriate logger, dependently on whether it is a command line utility or the daemon? -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman

Re: Handle SIGINT in C and Python (Posting On Python-List Prohibited)

2018-01-31 Thread Victor Porton
Lawrence D’Oliveiro wrote: > On Thursday, February 1, 2018 at 5:57:58 PM UTC+13, Victor Porton wrote: >> I meant to call poll() from C code, not Python code. > > Do you need to use C code at all? Python is quite capable of handling this > <https://docs.python.org/3/lib

Re: Handle SIGINT in C and Python (Posting On Python-List Prohibited)

2018-01-31 Thread Victor Porton
Lawrence D’Oliveiro wrote: > On Thursday, February 1, 2018 at 8:10:24 AM UTC+13, Victor Porton wrote: >> Lawrence D’Oliveiro wrote: >> >>> The usual behaviour for POSIX is that the call is aborted with EINTR >>> after you get the signal. >> >> T

Re: Help to debug my free library

2018-01-31 Thread Victor Porton
Dennis Lee Bieber wrote: > On Wed, 31 Jan 2018 20:58:56 +0200, Victor Porton > declaimed the following: > >>LibComCom is a C library which passes a string as stdin of an OS command >>and stores its stdout in another string. >> >>I wrote this library recen

Re: Help to debug my free library

2018-01-31 Thread Victor Porton
wxjmfa...@gmail.com wrote: > Le mercredi 31 janvier 2018 20:13:06 UTC+1, Chris Angelico a écrit : >> On Thu, Feb 1, 2018 at 5:58 AM, Victor Porton wrote: >> > LibComCom is a C library which passes a string as stdin of an OS >> > command and stores its stdout in anoth

Re: Help to debug my free library

2018-01-31 Thread Victor Porton
Chris Angelico wrote: > On Thu, Feb 1, 2018 at 5:58 AM, Victor Porton wrote: >> LibComCom is a C library which passes a string as stdin of an OS command >> and stores its stdout in another string. > > Something like the built-in subprocess module does? I was going to

Re: Handle SIGINT in C and Python (Posting On Python-List Prohibited)

2018-01-31 Thread Victor Porton
Lawrence D’Oliveiro wrote: > On Wednesday, January 31, 2018 at 9:55:45 PM UTC+13, Victor Porton wrote: >> Lawrence D’Oliveiro wrote: >> >>> On Wednesday, January 31, 2018 at 8:58:18 PM UTC+13, Victor Porton >>> wrote: >>>> For this reason I >>&g

Help to debug my free library

2018-01-31 Thread Victor Porton
Traceback (most recent call last): Segmentation fault (here libcomcom.so is installed in /usr/local/lib) -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list

Re: Handle SIGINT in C and Python (Posting On Python-List Prohibited)

2018-01-31 Thread Victor Porton
Lawrence D’Oliveiro wrote: > On Wednesday, January 31, 2018 at 8:58:18 PM UTC+13, Victor Porton wrote: >> For this reason I >> cannot use Python signals because "A Python signal handler does not get >> executed inside the low-level (C) signal handler. Instead, the low-le

Re: Handle SIGINT in C and Python

2018-01-31 Thread Victor Porton
Victor Porton wrote: > I need to assign a real C signal handler to SIGINT. > > This handler may be called during poll() waiting for data. For this reason > I cannot use Python signals because "A Python signal handler does not get > executed inside the low-level (C) signal h

Handle SIGINT in C and Python

2018-01-31 Thread Victor Porton
dler). Is this possible? How? -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list

Re: Package containing C sources (Posting On Python-List Prohibited)

2018-01-30 Thread Victor Porton
Lawrence D’Oliveiro wrote: > On Wednesday, January 31, 2018 at 6:13:00 PM UTC+13, Victor Porton wrote: >> I am going to create a Python wrapper around a generally useful C >> library. So the wrapper needs to contain some C code to glue them >> together. > > Not neces

Package containing C sources

2018-01-30 Thread Victor Porton
I am going to create a Python wrapper around a generally useful C library. So the wrapper needs to contain some C code to glue them together. Can I upload a package containing C sources to PyPi? If not, what is the proper way to distribute it? -- Victor Porton - http://portonvictor.org

Re: Python package to accept payments in Internet

2017-05-04 Thread Victor Porton
Gregory Ewing wrote: > Victor Porton wrote: >> You carp with words, finding a problem where there is no real problem, >> just words (I mean the word "hack") which sound like a problem. > > Words are important. The very fact that it sounds like a > problem

Re: Python package to accept payments in Internet

2017-05-03 Thread Victor Porton
On Wed, 2017-05-03 at 17:02 +0200, Chris Warrick wrote: > On 3 May 2017 at 16:45, Victor Porton wrote: > > Steve D'Aprano wrote: > >  > > > On Wed, 3 May 2017 02:19 am, Victor Porton wrote: > > >  > > > > I have created a full featu

Re: Python package to accept payments in Internet

2017-05-03 Thread Victor Porton
Chris Warrick wrote: > On 3 May 2017 at 17:19, Victor Porton wrote: >> What do you mean by "banned"? Does this mean that Google does not use >> software of this license? > > https://opensource.google.com/docs/using/agpl-policy/ > https:

Re: Python package to accept payments in Internet

2017-05-03 Thread Victor Porton
On Wed, 2017-05-03 at 17:02 +0200, Chris Warrick wrote: > On 3 May 2017 at 16:45, Victor Porton wrote: > > Steve D'Aprano wrote: > > > > > On Wed, 3 May 2017 02:19 am, Victor Porton wrote: > > > > > > > I have created a full featu

Re: Python package to accept payments in Internet

2017-05-03 Thread Victor Porton
Steve D'Aprano wrote: > On Wed, 3 May 2017 02:19 am, Victor Porton wrote: > >> I have created a full featured package to accept payments in Internet >> (currently supports PayPal). > [...] >> Buy the commercial version and support scientific research and a

Python package to accept payments in Internet

2017-05-02 Thread Victor Porton
gateway for many different payment processors. Buy the commercial version and support scientific research and a new principle of the Web I am working on. I hope you don't take this message as spam. Is it OK to post updates of our software to this mailing list in the future? -- Victor Porton -

Re: Python for WEB-page !?

2017-01-06 Thread Victor Porton
t. Consider PyPi. I never used it, but they say, it is faster than usual CPython interpreter. > I waiting with higher interest your feedback. > > Thanks to all members of community for support and advice. > Keep in touch. > Kind regards. -- Victor Porton - http://portonvictor.org --

Re: Python for WEB-page !?

2017-01-05 Thread Victor Porton
t. Consider PyPi. I never used it, but they say, it is faster than usual CPython interpreter. > I waiting with higher interest your feedback. > > Thanks to all members of community for support and advice. > Keep in touch. > Kind regards. -- Victor Porton - http://portonvictor.org --

Re: Which of two variants of code is better?

2016-11-21 Thread Victor Porton
Ned Batchelder wrote: > On Monday, November 21, 2016 at 12:48:25 PM UTC-5, Victor Porton wrote: >> Which of two variants of code to construct an "issue comment" object >> (about BitBucket issue comments) is better? >> >> 1. >> >> obj = IssueCo

Which of two variants of code is better?

2016-11-21 Thread Victor Porton
nt)] obj = construct_subobject(repository, list) (`construct_subobject` is to be defined in such as way that "1" and "2" do the same.) Would you advise me to make such function construct_subobject function or just to use the direct coding as in "1"? -- Victor Porton -

Extra base class in hierarchy

2016-11-19 Thread Victor Porton
... -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list

Re: Two variants of class hierachy

2016-11-19 Thread Victor Porton
Peter Otten wrote: > Victor Porton wrote: > >> I am developing software which shows hierarchical information (tree), >> including issues and comments from BitBucket (comments are sub-nodes of >> issues, thus it forms a tree). >> >> There are two kinds of

C3 MRO

2016-11-19 Thread Victor Porton
Do I understand correctly, than C3 applies to particular methods, and thus it does not fail, if it works for every defined method, even if it can fail after addition of a new method? Also, at which point it fails: at definition of a class or at calling a particular "wrong" method?

Two variants of class hierachy

2016-11-19 Thread Victor Porton
# diamonds: class A(BitBucketHierarchyLevel, HierarchyLevelWithPagination): ... class B(BitBucketHierarchyLevel, HierarchyLevelWithShortList): ... -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list