Package containing C sources
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 -- https://mail.python.org/mailman/listinfo/python-list
Re: Package containing C sources (Posting On Python-List Prohibited)
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 necessarily. It’s often possible to implement such a wrapper entirely > in Python, using ctypes <https://docs.python.org/3/library/ctypes.html>. But if I will find that I need C code, do I need to package it separately? So I would get three packages: the C library, the C wrapper for Python, and the Python code. Can this be done with just two packages: the C library and C wrapper and Python in one package? -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list
Handle SIGINT in C and Python
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 handler. Instead, the low-level signal handler sets a flag which tells the virtual machine to execute the corresponding Python signal handler at a later point(for example at the next bytecode instruction)." I want after my signal handler for SIGINT executed to raise KeyboardInterrupt (as if I didn't installed my own signal handler). Is this possible? How? -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list
Re: Handle SIGINT in C and Python
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 handler. Instead, the low-level > signal handler sets a flag which tells the virtual machine to execute the > corresponding Python signal handler at a later point(for example at the > next bytecode instruction)." > > I want after my signal handler for SIGINT executed to raise > KeyboardInterrupt (as if I didn't installed my own signal handler). > > Is this possible? How? I've found a solution: I can use PyOS_setsig() from Python implementation to get the old (Python default) OS-level signal handler, while I assign the new one. -- 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)
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-level >> signal handler sets a flag which tells the virtual machine to execute the >> corresponding Python signal handler at a later point(for example at the >> next bytecode instruction)." > > Why is that a problem? As I already said, I need to handle the signal (SIGCHLD) while poll() waits for i/o. You can read the sources (and the file HACKING) of the C library which I am wrapping into Python here: https://github.com/vporton/libcomcom -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list
Help to debug my free library
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 recently: https://github.com/vporton/libcomcom Complete docs are available at https://vporton.github.io/libcomcom-docs/ Now I am trying to make Python bindings to the library: https://github.com/vporton/libcomcom-python I use CFFI (API level). However testing my Python bindings segfaults in an unknown reason. Please help to debug the following: $ LD_LIBRARY_PATH=.:/usr/local/lib:/usr/lib:/lib \ PYTHONPATH=build/lib.linux-x86_64-2.7/ python test2.py 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)
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 >>>> cannot use Python signals because "A Python signal handler does not get >>>> executed inside the low-level (C) signal handler. Instead, the >>>> low-level signal handler sets a flag which tells the virtual machine to >>>> execute the corresponding Python signal handler at a later point(for >>>> example at the next bytecode instruction)." >>> >>> Why is that a problem? >> >> As I already said, I need to handle the signal (SIGCHLD) while poll() >> waits for i/o. > > The usual behaviour for POSIX is that the call is aborted with EINTR after > you get the signal. That poll() is interrupted does not imply that Python will run its pythonic signal handler at the point of interruption. That is a problem. -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list
Re: Help to debug my free library
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 write: "It seems that subprocess module can cause deadlocks. For example, if it first writes a long string to "cat" command input (going to read cat's stdout later), then "cat" would block because its output is not read while writing input." But after reading the docs it seems that Popen.communicate() does the job. Well, I first wrote in Java. For Java there was no ready solution. Later I switched to Python and haven't checked the standard libraries. So, please help me to make sure if Popen.communicate() is a solution for my problem (namely that it does not deadlock, as in "cat" example above). I am interested in both Python 2.7 and 3.x. > ChrisA -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list
Re: Help to debug my free library
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 another string. >> >> Something like the built-in subprocess module does? >> >> ChrisA > > Do you mean the buggy subprocess module (coding of characters) ? Please elaborate: which bugs it has? in which versions? > Yes, there is a working workaround : QtCore.QProcess(). -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list
Re: Help to debug my free library
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 recently: >>https://github.com/vporton/libcomcom >> >>Complete docs are available at >>https://vporton.github.io/libcomcom-docs/ >> >>Now I am trying to make Python bindings to the library: >>https://github.com/vporton/libcomcom-python >> > > Debug -- no help, I'm not a fluent Linux programmer... > > But based upon the description of this library, I would have to ask: > > "What does this library provide that isn't already in the Python standard > library?" > > "Why would I want to use this library instead of, say > subprocess.Popen().communicate()?" (or the older Popen* family) > > {Though .communicate() is a one-shot call -- sends one packet to > subprocess' stdin, reads to EOF, and waits for subprocess to terminate. If > one needs interactive control, one needs explicit write/read calls, > although those can deadlock if the caller and subprocess aren't written > for such interaction} If it "sends one packet", this would lead to a deadlock (even for "cat" command). Hopefully, you are wrong here. I found that Popen.communicate() seems to solve my problem. (Previously I programmed in Java and found no native solution. For this reason I created my LibComCom.) -- 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)
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. >> >> That poll() is interrupted does not imply that Python will run its >> pythonic signal handler at the point of interruption. That is a problem. > > * Python calls poll() > * poll() aborted with EINTR > * Python runs your signal handler > > Versus native C code: > > * your code calls poll() > * poll() aborted with EINTR > * your signal handler is run > > Where is there a fundamental difference? I meant to call poll() from C code, not Python code. In this case when poll() is aborted with EINTR, the pythonic signal handler does not run. -- 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)
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/library/select.html>. I already concluded that I can use Popen.communicate() instead of my library. So the issue is closed. -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list
Dependency injection: overriding defaults
I am writing a library, a command line utility which uses the library, and a daemon which uses the library. I am going to use dependency_injector package. Consider loggers: For the core library the logger should default to stderr. For the command line utility, we use the default logger of the 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/listinfo/python-list
Object-oriented gettext
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 before each gettext() call. I want an object oriented interface like: english.gettext("Word") == "Word" russian.gettext("Word") == "Слово" That is, I do no want to write any language-switching code, but the language should depend on the object (like "english" and "russian" in the 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
Advice on where to define dependency injection providers
I define ExecutionContext in xmlboiler.core.execution_context module. ExecutionContext is meant to contain a common "environment" suitable for different kinds of tasks. Currently ExecutionContext contains a logger and a translator of messages: class ExecutionContext(object): def __init__(self, logger, translations): """ :param logger: logger :param translations: usually should be gettext.GNUTranslations """ self.logger = logger self.translations = translations Now I want to define some "provides" using dependency_injector.providers module. Where (in which module) should I define default factories for loggers, translations, and execution contexts? (Default logger should log to stderr, default translations should respect LANG environment variable.) The only quite clear thing is that providers should be defined somewhere in xmlboiler.core.* namespace, because it is the namespace for the core library (to be used by several applications). Should I define providers in xmlboiler.core.execution_context module or in something like xmlboiler.core.execution_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
Re: Object-oriented gettext
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 before each gettext() > call. > > I want an object oriented interface like: > > english.gettext("Word") == "Word" > russian.gettext("Word") == "Слово" > > That is, I do no want to write any language-switching code, but the > language should depend on the object (like "english" and "russian" in the > above example). > > What is the best way to do this? > > Should I write an object-oriented wrapper around gettext package? Oh, I see that gettext.translation() seems to do the job. -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list
Re: Dependency injection: overriding defaults
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 stderr. >> >> For the command line utility, we use the default logger of the 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? > > I would distinguish between the common library and distinct > applications (command line utility, daemon). The applications > configure the logging system (differently) while the library uses > uniform logging calls. You have essentially just repeated my requirements. But HOW to do this (using dependency_injector module)? -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list
$srcdir and $datadir
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: $srcdir and $datadir
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 C >> code through generated config.h file. > > For what purpose? I want my program to work both when it is installed (using $datadir) and when it is not yet installed (using $srcdir). > Given that the source may not be at that location after the program is > compiled – especially, after the program is moved to a different machine > – what meaning does ‘$srcdir’ have when the program is running? In GNU system there is support of storing a value (such as source directory) into the program itself. If it is moved to a different machine, $srcdir remains the same. > What “data directory” is specified by ‘$datadir’, and why is it assumed > there is exactly one? It may be exactly one, but contain subdirectories. >> What is the right way to config directories for a Python program? > > We'll need to know what those concepts mean, to be able to discuss the > equivalent (if any) in a Python environment. -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list
What is more Pythonic: subclass or adding functionality to base class?
The following is a real code fragment: ## class PredicateParser(object, metaclass=ABCMeta): """ Parses a given predicate (which may participate in several relationships) of a given RDF node. """ def __init__(self, predicate): self.predicate = predicate @abstractmethod def parse(self, parse_context, graph, node): pass ## Now I need to add new field on_error (taking one of three enumerated values) to some 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 - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list
Two variants of class hierachy
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 objects in the hierarchy: a. with a (possibly long) paginated list of childs; b. with a short list of strings, each string being associated with a child object. I have two variants of class inheritance in mind. Please help to decide which is better. The first one declares only one base class, but some its method remain unimplemented (raise NotImplementedError) even in derived classes. The second one defines two distinct base classes HierarchyLevelWithPagination (for objects of above described class "a") and HierarchyLevelWithShortList (for objects of above described class "b"), but use multiple inheritance. # VARIANT 1: # class HierarchyLevel(object): def get_node(self): return None def childs(self, url, page, per_page=None): raise NotImplementedError() def short_childs(self): raise NotImplementedError() class BitBucketHierarchyLevel(HierarchyLevel): ... # A implements only childs() but not short_childs() class A(BitBucketHierarchyLevel): ... # B implements only short_childs() but not childs() class B(BitBucketHierarchyLevel): ... ## OR ## # VARIANT 2: # class HierarchyLevel(object): def get_node(self): return None class HierarchyLevelWithPagination(HierarchyLevel): def childs(self, url, page, per_page=None): raise NotImplementedError() class HierarchyLevelWithShortList(HierarchyLevel): def short_childs(self): raise NotImplementedError() ## THEN ## # code specific for BitBucket class BitBucketHierarchyLevel(HierarchyLevel): ... # diamonds: class A(BitBucketHierarchyLevel, HierarchyLevelWithPagination): ... class B(BitBucketHierarchyLevel, HierarchyLevelWithShortList): ... -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list
C3 MRO
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? -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list
Re: Two variants of class hierachy
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 objects in the hierarchy: a. with a (possibly >> long) paginated list of childs; b. with a short list of strings, each >> string being associated with a child object. >> >> I have two variants of class inheritance in mind. Please help to decide >> which is better. >> >> The first one declares only one base class, but some its method remain >> unimplemented (raise NotImplementedError) even in derived classes. > > Two observations: > > In Python you can also use "duck-typing" -- if you don't want to share > code between the classes there is no need for an inhertitance tree at all. I know, but explicit inheritance serves as a kind of documentation for readers of my code. > Pagination is a matter of display and will be handled differently in a PDF > document or web page, say. I would not make it part of the data structure. Not in my case, because the data I receive is already paginated. I am not going to "re-paginate" it in another way. -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list
Extra base class in hierarchy
Consider class FinalTreeNode(object): def childs(self): return [] class UsualTreeNode(FinalTreeNode) def childs(self): return ... In this structure UsualTreeNode derives from FinalTreeNode. Is it better to introduce an extra base class? class BaseTreeNode(object): def childs(self): return [] # The same functionality as BaseTreeNode, but logically distinct class FinalTreeNode(BaseTreeNode): pass # Not derived from FinalTreeNode, because it is not logically final class UsualTreeNode(BaseTreeNode) def childs(self): return ... -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list
Which of two variants of code is better?
Which of two variants of code to construct an "issue comment" object (about BitBucket issue comments) is better? 1. obj = IssueComment(Issue(IssueGroup(repository, 'issues'), id1), id2) or 2. list = [('issues', IssueGroup), (id1, Issue), (id2, IssueComment)] 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 - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list
Re: Which of two variants of code is better?
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 = IssueComment(Issue(IssueGroup(repository, 'issues'), id1), id2) >> >> or >> >> 2. >> >> list = [('issues', IssueGroup), (id1, Issue), (id2, IssueComment)] >> 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"? > > Neither of these seem very convenient. I don't know what an IssueGroup is, It is a helper object which helps to paginate issues. > so I don't know why I need to specify it. To create a comment on an > issue, why do I need id2, which seems to be the id of a comment? It does not create a comment. It is preparing to load the comment. > How about this: > > obj = IssueComment(repo=repository, issue=id1) > > or: > > obj = repository.create_issue_comment(issue=id1) Your code is too specialized. I want to make all my code following the same patterns. (And I am not going to define helper methods like yours, because we do not use it often enough to be worth of a specific method.) -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list
Re: Python for WEB-page !?
Ionut Predoiu wrote: > I am a beginner in programming language. > I want to know what version of Python I must to learn to use, beside of > basic language, because I want to integrate in my site 1 page in which > users to can made calculus based on my formulas already write behind (the > users will only complete some field, and after push "Calculate" button > will see the results in form of: table, graphic, and so on ...). Please > take into account that behind will be more mathematical > equations/formulas, so the speed I think must be take into account. 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 -- https://mail.python.org/mailman/listinfo/python-list
Re: Python for WEB-page !?
Ionut Predoiu wrote: > I am a beginner in programming language. > I want to know what version of Python I must to learn to use, beside of > basic language, because I want to integrate in my site 1 page in which > users to can made calculus based on my formulas already write behind (the > users will only complete some field, and after push "Calculate" button > will see the results in form of: table, graphic, and so on ...). Please > take into account that behind will be more mathematical > equations/formulas, so the speed I think must be take into account. 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 -- https://mail.python.org/mailman/listinfo/python-list
Recommended format for --log-level option
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/python-list
Python package to accept payments in Internet
I have created a full featured package to accept payments in Internet (currently supports PayPal). It has especially great support for recurring payments. Here it is: http://freesoft.portonvictor.org/django-debits.xml I hope we with community work will turn it into an universal payment 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 - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list
Re: Python package to accept payments in Internet
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 new >> principle of the Web I am working on. > > What licence is your package? Is it under an open source licence, or > commercial closed source, or is there a choice? It is licensed both AGPLv3+ (an open source license) and a commercial license. The AGPL license requires you to publish your Web application source code if my package is called from your software. Thus you may need the commercial license for your closed source Web application (that is for your site). See http://freesoft.portonvictor.org/django-debits.xml for more information. -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list
Re: Python package to accept payments in Internet
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 featured package to accept payments in > > > > Internet > > > > (currently supports PayPal). > > > > > > [...] > > > > Buy the commercial version and support scientific research and > > > > a new > > > > principle of the Web I am working on. > > > > > > What licence is your package? Is it under an open source licence, > > > or > > > commercial closed source, or is there a choice? > > > > It is licensed both AGPLv3+ (an open source license) and a > > commercial > > license. > > > > The AGPL license requires you to publish your Web application > > source code if > > my package is called from your software. > > > > Thus you may need the commercial license for your closed source Web > > application (that is for your site). > > > > See > > > > http://freesoft.portonvictor.org/django-debits.xml > > > > for more information. > > The AGPL license is banned by Google, and perhaps many others. There What do you mean by "banned"? Does this mean that Google does not use software of this license? > are other packages for handling payments, many with a saner license > and available for free, so you’ll be pretty unsuccessful. I have found no other good Python packages to receive payments. My package is prominent that it has especially great support for recurring payments, not a feature of other packages. See http://freesoft.portonvictor.org/django-debits.xml about more features of my package. My package is a professional tool unlike other's hacks. > Also, this line looks unconvincing: > > # This is a quick hack. For serious work use > https://github.com/paypal/PayPal-Python-SDK instead. This quick hack does work for the purpose it was made. This class is not feature-rich, but other features are not needed by other parts of my software. So it's OK. > source: https://github.com/vporton/django-> > debits/blob/fe8681042dbbf0353d1a29299280326a059452ca/debits/paypal/mo > dels.py#L9 > > Your website is ugly, uses default browser styles, and to me it feels > like you don’t pay attention to important stuff. That’s not someone > who I’d trust to do payments right. I with my partner are founding a new company. The company site is not yet online. It should be online soon. There we will have a well designed page for this my product. -- https://mail.python.org/mailman/listinfo/python-list
Re: Python package to accept payments in Internet
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://www.theregister.co.uk/2011/03/31/google_on_open_source_licenses/ It is irrelevant for me that Google Code bans my license (by the way it seems that Google banned it only in the past, not now). I anyway host it at GitHub not at Google Code. >> My package is a professional tool unlike other's hacks. > > You yourself called your code a hack: > >>> Also, this line looks unconvincing: >>> >>> # This is a quick hack. For serious work use >>> https://github.com/paypal/PayPal-Python-SDK instead. Here I use the word "hack" to mean "something that works but isn't a full featured solution". This hack in my software applies to a very small fragment of my code not to entire code. That this small fragment is a hack does not influence the external behavior of the software. Thus it does not matter for users of my software. >> This quick hack does work for the purpose it was made. This class is >> not feature-rich, but other features are not needed by other parts of >> my software. So it's OK. > > No, it’s not okay. Quick hacks are never good when dealing with money. I made this hack with only one purpose, to avoid dependency on https://github.com/paypal/PayPal-Python-SDK. Thus this "hack" eases installation of my software: the user needs to install only one package rather than two. Also it makes my software to load quicker. So this hack is a benefit for the user not a deficiency. And nothing prevents the user to use PayPal-Python-SDK with or instead of this my quick hack. 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. -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list
Re: Python package to accept payments in Internet
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 featured package to accept payments in > > > > Internet > > > > (currently supports PayPal). > > > > > > [...] > > > > Buy the commercial version and support scientific research and > > > > a new > > > > principle of the Web I am working on. > > > > > > What licence is your package? Is it under an open source licence, > > > or > > > commercial closed source, or is there a choice? > > > > It is licensed both AGPLv3+ (an open source license) and a > > commercial > > license. > > > > The AGPL license requires you to publish your Web application > > source code if > > my package is called from your software. > > > > Thus you may need the commercial license for your closed source Web > > application (that is for your site). > > > > See > > > > http://freesoft.portonvictor.org/django-debits.xml > > > > for more information. > > The AGPL license is banned by Google, and perhaps many others. There What do you mean by "banned"? Does this mean that Google does not use software of this license? > are other packages for handling payments, many with a saner license > and available for free, so you’ll be pretty unsuccessful. I have found no other good Python packages to receive payments. My package is prominent that it has especially great support for recurring payments, not a feature of other packages. See http://freesoft.portonvictor.org/django-debits.xml about more features of my package. My package is a professional tool unlike other's hacks. > Also, this line looks unconvincing: > > # This is a quick hack. For serious work use > https://github.com/paypal/PayPal-Python-SDK instead. This quick hack does work for the purpose it was made. This class is not feature-rich, but other features are not needed by other parts of my software. So it's OK. > source: https://github.com/vporton/django- > debits/blob/fe8681042dbbf0353d1a29299280326a059452ca/debits/paypal/mo > dels.py#L9 > > Your website is ugly, uses default browser styles, and to me it feels > like you don’t pay attention to important stuff. That’s not someone > who I’d trust to do payments right. I with my partner are founding a new company. The company site is not yet online. It should be online soon. There we will have a well designed page for this my product. -- https://mail.python.org/mailman/listinfo/python-list
Re: Python package to accept payments in Internet
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 *is* a problem if you're trying to persuade people > to use your software, especially something as critical as > a payment system. Comments like that are going to make > people wonder what other shortcuts have been taken > elsewhere in the code. > > We're not criticising the code so much as suggesting you > re-word the comment. Something like "This code only > provides a subset of the possible functionality, for > something more comprehensive see..." would be a lot > better. Thank you. I've changed the wording as you suggested. -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list