Authorize - 0.0.4
Hello everyone, Adroll.com released today the first open source version of the authorize.net payment integration library. This new library supports the 3 main APIs (CIM, AIM and ARB) exposed by Authorize.net in both a synchronous and an asynchronous (using Twisted Matrix) way. The main page, although pretty naked right now, is here: http://www.adroll.com/labs PyPI page: http://pypi.python.org/pypi/authorize Mailing list: http://groups.google.com/group/authorize-users Source code: http://www.bitbucket.org/adroll/authorize/ Authorize.net is a commercial payment gateway with customer information management functionalities. It enables merchants to authorize, settle and manage credit card and electronic check transactions via Web sites, retail stores, mail order/telephone order (MOTO) call centers and mobile devices. -- Valentino Volonghi aka Dialtone http://stacktrace.it -- Aperiodico di resistenza informatica Blog: http://www.twisted.it/ Public Beta: http://www.adroll.com/ -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations.html
Re: Python 2.6: Determining if a method is inherited
Fuzzyman [EMAIL PROTECTED] wrote: So how do I tell if the X.__lt__ is inherited from object? I can look I don't have python 2.6 installed so I can't try but what I think could work is: class Foo(object): ... def hello(self): ... pass ... class Bla(Foo): ... def hello(self): ... pass ... class Baz(Foo): ... pass ... Baz.hello.im_func function hello at 0x2b1630 Bla.hello.im_func function hello at 0x2b1670 Foo.hello.im_func function hello at 0x2b1630 Foo.hello.im_func is Baz.hello.im_func True Foo.hello.im_func is Bla.hello.im_func False Which to me also makes sense. If it's inherited I expect it to be the very same function object of one of the bases (which you can get with inspect.getmro(Clazz)). On the other end if you override it it's not the same function object so it won't return True when applied to 'is'. HTH -- Valentino Volonghi aka Dialtone http://stacktrace.it -- Aperiodico di resistenza informatica Blog: http://www.twisted.it/ Public Beta: http://www.adroll.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Python to use a non open source bug tracker?
Terry Reedy [EMAIL PROTECTED] wrote: As I understood B.C.'s announcement, that was one of the judging criteria, and the plan is for PSF to get a daily backup dump of the data. This had nothing to do with the choice of not using Trac or Launchpad. Quoting Brett Cannon from the original mail: As for Trac and Launchpad, both had fundamental issues that led to them not being chosen in the end. Most of the considerations had to do with customization or UI problems. So clearly the 'get a daily backup of the data' is not the reason. Backing up a sqlite database is pretty easy. -- Valentino Volonghi aka Dialtone Now Running MacOSX 10.4 Blog: http://vvolonghi.blogspot.com New Pet: http://www.stiq.it -- http://mail.python.org/mailman/listinfo/python-list
Re: Python to use a non open source bug tracker?
Steve Holden [EMAIL PROTECTED] wrote: So clearly the 'get a daily backup of the data' is not the reason. Backing up a sqlite database is pretty easy. Do you have any idea fo the scale of the Python issue (bug) database? Do you really think SQLite would be a suitable platform for it? Considering that trac can also run on postgres or mysql and also considering that both of these databases have enough tools to deal with backups I think it's a non issue. -- Valentino Volonghi aka Dialtone Now Running MacOSX 10.4 Blog: http://vvolonghi.blogspot.com New Pet: http://www.stiq.it -- http://mail.python.org/mailman/listinfo/python-list
Re: Python vs. Lisp -- please explain
Steven D'Aprano [EMAIL PROTECTED] wrote: By that logic, all languages are interpreted. What do you think happens to the machinecode? Interpreted to transistors state by an internal mapping in the CPU opcode == input configuration. -- Valentino Volonghi aka Dialtone Now Running MacOSX 10.4 Blog: http://vvolonghi.blogspot.com New Pet: http://www.stiq.it -- http://mail.python.org/mailman/listinfo/python-list
Re: Still Loving Python
Paul Rubin http://[EMAIL PROTECTED] wrote: Glade also does something like that. Indeed. I'd also add some lines on this. There is a very nice designer for GTK+ applications called Gazpacho, written in python and available here: http://gazpacho.sicem.biz/ It generates an XML file in the same Glade format (actually it's slightly different for the Menus). It doesn't require libglade though because it has its own .glade loader and thanks to this at load time it can bind events using method names in your 'controller' class (which inherits from gazpacho's Proxy class. This means that, if you are using python, you don't even have to define the actions and action handlers in the designer. for example: class LogsterClient(Proxy): def on_connect__clicked(self, button): def on_logster__destroy(self, window): p = Proxy('my_ui.glade') And it also provide an easy and flexible way to integrate additional custom widgets in the design process. Of course it's always possible to build powerful GUIs without using designers at all: http://www.lethalman.net/?p=21 -- Valentino Volonghi aka Dialtone Now Running MacOSX 10.4 Blog: http://vvolonghi.blogspot.com http://weever.berlios.de -- http://mail.python.org/mailman/listinfo/python-list
Re: Python Jabber client?
Paul Rubin http://[EMAIL PROTECTED] wrote: If there's more than one, does anyone have a favorite? twibber http://slarty.polito.it:8069/~sciasbat/wiki/moin.cgi/twibber Based on Twisted. Will probably be included in Twisted at some point in the future. Twisted already has a jabber protocol implementation inside it but it's very simple (and for example doesn't support SASL). -- Valentino Volonghi aka Dialtone Now Running MacOSX 10.4 Blog: http://vvolonghi.blogspot.com http://weever.berlios.de -- http://mail.python.org/mailman/listinfo/python-list
Re: Python compiled?
billiejoex [EMAIL PROTECTED] wrote: interpretation and compilation at the same time, should be a great advantage. Python is compiled and needs a runtime environment. just like java does and like C needs the C standard library installed. I can see no differences except one is compiled to native code, the other is compiled to bytecode and JITted or interpreted and python is compiled to bytecode and interpreted or (with psyco) JITted. -- Valentino Volonghi aka Dialtone Now Running MacOSX 10.4 Blog: http://vvolonghi.blogspot.com http://weever.berlios.de -- http://mail.python.org/mailman/listinfo/python-list
Re: Release of PyPy 0.7.0
Michael Sparks [EMAIL PROTECTED] wrote: Would it be useful for people to start trying out their modules/code to see if they work with this release, and whether they can likewise be translated using the C/LLVM backends, or would you say this is too early? (I'm more thinking in terms of it providing real world usecases in the hope of finding things that don't work - rather than anything else) This is not how it works. Pypy doesn't translate your code to C/LLVM. Currently PyPy can only translate a pretty simple subset of python called RPython which has a very C-like syntax (but without memory management code). This is needed to allow type inference inside the interpreter code. The code in your application is application code and can be whatever you want, you may try to translate it to C/LLVM but it won't be that good of course because the annotator is not that intelligent. Just In Time compilation a-la-psyco is planned before the 1.0 release of pypy. Right now also the compiler/parser run in application level which means it is rather slow because it is not translated like the rest of pypy (which accounts for quite a bit of the slowness of the translated pypy) [this is of course only true if they didn't manage to rewrite the parser/compiler in RPython, which I admit I'm not sure] More information is available on codespeak.net website :). What's really cool in PyPy is how easily you can implement a new object space and change semantics of operations done in python. Writing a Python interpreter that can share data structures across many computers will be hard but possible. There are already 4 different object spaces implemented, the standard one, the thunk one (which is a lazy evaluation object space), the flowgraph object space and the trace object space that traces each operation done. Either way, this looks like a great milestone - congratulations to the entire team. (I remember PyPy being met with skepticism as to whether it could even be done! :-) Indeed. -- Valentino Volonghi aka Dialtone Now Running MacOSX 10.4 Blog: http://vvolonghi.blogspot.com http://weever.berlios.de -- http://mail.python.org/mailman/listinfo/python-list
Re: Python for Webscripting (like PHP)
Alessandro Bottoni [EMAIL PROTECTED] wrote: (Python has even been told to be used by Yahoo! and Google, among others, but nobody was able to demonstrate this, so far) ? Google and Microsoft and Nokia had talks during PyCon 2005. If you look at the GMAIL help system you would see that all the links in there end in .py. Blogger is almost completely built with python. Google is also one of the members of the PSF. What should be demonstrated? -- Valentino Volonghi aka Dialtone Now Running MacOSX 10.4 Blog: http://vvolonghi.blogspot.com http://weever.berlios.de -- http://mail.python.org/mailman/listinfo/python-list
Re: Web Framework Reviews
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I thought it would make sense to write up some of my experiences with python based web frameworks: http://www.personal.psu.edu/staff/i/u/iua1/python_reviews.html You've never used Nevow, have you? Comparing it to Cheetah or ZPT means that you never used it. Nevow is exactly what you define as a web framework, and it would be quite interesting to know why you didn't put it in that section. -- Valentino Volonghi aka Dialtone Now Running MacOSX 10.4 Blog: http://vvolonghi.blogspot.com http://weever.berlios.de -- http://mail.python.org/mailman/listinfo/python-list
Re: Web Framework Reviews
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have not used Nevow but I have seen a few examples of how it works and I kept track of it over the years. It used to be very similar to how Cheetah or ZPT does its job. You had a template, and you filled it with data to produce an output. It seems that it has now more features such a form submission and validation. Formless has been part of nevow since the very beginning. It has also been part of woven (Nevow predecessor), just like liveevil (now enhanced and called livepage). The only part of nevow that you can compare to ZPT or Cheetah is its xmlfile template language. There is no way you can run Nevow on top of any other framework. Also you don't pass data to the templating engine. It's nevow that parses the template and iterates over it to render the page. The template is very stupid in nevow and everything is done in nevow.flat.flattenFactory called by nevow.rend.Page. On the other hand I even in its current form I don't see how I would to the simple things that I need every day. Create a session, set a cookie, redirect to another url, perform HTTP autentication, create filter, use another templating language? This is also integral part of the functionality that I expect from an web framework. Web specific things exposed in some python ic way. Sessions are handled by default with twisted.web: from twisted.application import service, strports from nevow import appserver from nevow import rend, loaders, tags as t, inevow class RootPage(rend.Page): addSlash = True def display_session(self, ctx, data): return inevow.ISession(ctx).uid docFactory = loaders.stan( t.html[t.head[t.title[Session example]], t.body[display_session]] ) application = service.Application('Foobar') site = appserver.NevowSite(RootPage()) server = strports.service('8080', site) server.setServiceParent(application) Save this in a .py or .tac and run it with twistd -noy filename.tac/.py and open http://localhost:8080/ in your browser to see your session uid. If you want autentication: http://nevowexamples.adytum.us/sources/guarded.py http://nevowexamples.adytum.us/sources/guarded2.py There are 2 examples (in the standard nevow distribution) that show how to handle authentication in an application transparent way (you don't have to touch your application by any means to add user authentication, which means you can write everything without taking care of this aspect of the app and then add it later). To redirect to another url just call IRequest(ctx).redirect(newurl) before the rendering begins (like in rend.Page.beforeRender) or in rend.Page.locateChild. HTTPAuthentication is easily handled: http://nevowexamples.adytum.us/sources/http_auth.py just use that class as a base class for your blocked page. (this example is part of the standard nevow distribution). Nevow doesn't have filters because they are handled by twisted.web or twisted.web2 (which is, hopefully soon, going to be one of the required webservers to run nevow, the others are lighttpd, apache, any WSGI application server, nevow was in fact the first framework to support WSGI servers). If you want to use a different templating language you just need to write a custom loader. Somebody did this in the past (I don't recall the url of the project) that used cheetah-like templates. Then for the last point: you can expose directories or files using nevow.static.File exposed objects are: those set as a value in rend.Page.children dict, you can reach them with an url like: http://www.example.com/url/that/returns/a/page/inst/key_in_children_dict Or assign an object to a child_foobar attribute like: p = rend.Page() p.child_foobar = static.File('/etc/') Or return an object from a child_foobar method. Or override rend.Page.childFactory(self, ctx, segment) to return an object in a dynamic way depending on the value of the segment argument. It seems to me that you really never tracked Nevow, your information is very incomplete. I think you should complete it before talking about Nevow :). -- Valentino Volonghi aka Dialtone Now Running MacOSX 10.4 Blog: http://vvolonghi.blogspot.com http://weever.berlios.de -- http://mail.python.org/mailman/listinfo/python-list
Re: Web Framework Reviews
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I think you should take what you posted above and put it up on your main site, because right now there is no way to find any information like this. Your entire intro is about templating and leaves one with no clues as to what else is there. Right now there are at least 2 web sites: http://divmod.org/users/exarkun/nevow-api/ + file inevow.py in nevow. http://divmod.org/users/mg/nevow-doc/ And a new one: http://dictator.kieranholland.com/prose/Meet%20Stan.html And the page I linked in my previous post: http://nevowexamples.adytum.us/ this is a living site with the living examples distributed with nevow. at least one example of formless does not work right now because of changes that we are doing in trunk right now (only formless has some problems, all the others work pretty well). There are really a lot of examples, and you can learn a lot of stuff from them. More documentation will be useful for sure, but by just coming in the irc channel #twisted.web on freenode you would have obtained all the answers you wanted to write a better review paper :). One remark regarding stan. For me it is inconceivable that one would build (and debug) any complicated webpage as stan does it, one element at a time: docFactory = loaders.stan( t.html[t.head[t.title[Session example]], t.body[display_session]] ) The pages that I have to build invariably contain multiple nested html tables etc. I shudder to think that I would ever have to build them like that. I know you have an inverse ZPT like templates those are a lot friendlier on the eyes. For someone who is does not know what Nevow is seeing an example of Stan is very scary because IMO it does not scale at all. This again is just an opinion. I have a little project, developed during my little free time that is linked in my signature (weever). It has over 2000 lines of xhtml templates and you can see a living example here: http://vercingetorix.dyndns.org:20080/ I can guarantee you that when templates begin to be a bit too complex stan is what saves the day. I usually use xhtml for everything (and nevow has the best templating engine out there thanks to its flexibility and simplicity, there are only 3 special tags and 3 attributes, and we are working to make it even easier than that) but when xhtml gets complicated stan is incredibly useful. Anyway stan is also incredibly useful to write little examples without requiring a new xhtml file (ok... you may use loaders.xmlstr but...) And it does scale well anyway (Quotient is entirely built using stan and it's very big). Templating engines like ZPT prefer to put some code in the template, Nevow prefers to put code in python and allow you to write some xhtml in python too. python is easier to manage and less likely to be screwed by any designer that doesn't know what python is. Thanks for the explanations. np :) -- Valentino Volonghi aka Dialtone Now Running MacOSX 10.4 Blog: http://vvolonghi.blogspot.com http://weever.berlios.de -- http://mail.python.org/mailman/listinfo/python-list
Re: Web Framework Reviews
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I think the difficulties will arise from the inability to visually track closing tags. ]]] versus /tr/tr/table You can do things like: t.html[ t.head[ t.title[Foobar] ], t.body[ t.p[This is some content] ] ] This is not harder than normal xhtml tags to follow. plus you don't have to remember what tag you are closing :) -- Valentino Volonghi aka Dialtone Now Running MacOSX 10.4 Blog: http://vvolonghi.blogspot.com http://weever.berlios.de -- http://mail.python.org/mailman/listinfo/python-list
Re: Python becoming less Lisp-like
Bruno Desthuilliers [EMAIL PROTECTED] wrote: A few examples: - A statement is different from an expression (2 special cases instead of one general case). - You can't use statements in a lambda Good reason to remove lambda, let's do this asap. - to get the length of a sequence, you use len(seq) instead of seq.len() I can see nothing wrong with this. seq.__len__() works equally well. - to call objects attributes by name, you use [get|set]attr(obj, name [,value]) instead of obj.[get|set]attr(name [,value]) this is the same as above. And I can see nothing wrong with this. This is not a special case but syntax sugar. If you feel more comfortable use the following: seq.__getattribute__('append') built-in method append of list object at 0x55fb48 - if x is a class attribute of class A and a is an instance of A, a.x=anyvalue create a new instance attribute x instead of modifying A.x How is this a wart? Do you understand mutable and immutable objects? In [7]: class A(object): ...: a = {} ...: b = 5 ...: In [8]: a = A() In [9]: b = A() # Modifying an immutable object yields a new object, thus a new binding In [10]: a.b = 3 In [11]: b.b Out[11]: 5 # Modyfing a mutable object doesn't change the original binding: In [12]: a.a['a'] = 4 In [13]: b.a Out[13]: {'a': 4} It would be a wart if it was like you thought it should be because the behaviour of objects changed depending on where they happend to be. - sequence methods that modify the sequence in place return None instead of returning self - ok, I know the rational for this one, but I still dont like it, and still count it as a special case since when using a 'destructive' sequence method I can't chain it with non-destructive method calls. This has nothing to do with special cases... Your countless special cases are coming out to be things you didn't really understand about python. - object.__getattr__ (if it exists...) is called only when attribute name is not found. object.__setattr__ (if it exists...) is always called. This is because of the new object model. Agree here, there should be only one: __getattr__ or __getattribute__. - functions are not methods functions are functions and methods are functions that take the instance of the object as their first argument. Anyway discussion is ongoing to remove the bound/unbound difference. Though you can actually do this: In [14]: class A(object): : def foo(self, a): : print hello world : In [15]: a = A() In [16]: a.foo(1) hello world In [17]: def baz(): : KeyboardInterrupt In [17]: def baz(self): : print hello world : In [18]: a.foo = baz.__get__(a) In [19]: a.foo() hello world - old-style classes vs new-style classes Agreed. Backwards compatibility wins here. Again Python 3k will remove this. Of all your points I agreed on only 3 or 4. This strikes me as a very well thought out language that in 15 years managed to only get 3 or 4 special cases. Also, Python enforce some coding style (indentation) but not some others (capitalization for example). So you always have to check, on a lib by you are mixing oranges and apples here. lib base, what style has been used (I personnaly don't give a damn whether I use underscore_all_lower or mixedCaps, but consistency is useful, even more when there's such a huge stdlib). Worst, the base class for new style classes is all lower ('object') when the usual convention is to use CamelCase for classes. Python standard library is consistent with this style. The only library I am aware of that doesn't follow this style is wxPython with wax, and I always discurage every python developer to use this library for this very reason. I can agree with you here, but this is not a special case. I'm not able to count them all, since a good part of them are not carved in my poor little brain - I just deal with them day after day. I love You are not able to count them all since there are almost not special cases. But many things that could be done in a better way (this is for sure, python is far from perfect, but it 'sucks' a lot less then everything else). -- Valentino Volonghi aka Dialtone Now Running MacOSX 10.3.8 Blog: http://vvolonghi.blogspot.com http://weever.berlios.de -- http://mail.python.org/mailman/listinfo/python-list
Re: Lisp-likeness
Thomas A. Russ [EMAIL PROTECTED] wrote: (defun addn (n) #'(lambda (x) (+ x n))) The same as def addn(n): def fn(x): return n + x return fn Is this really equivalent? yes What happens if you call addn more than once with different parameters. Will you get different functions that you can use simultaneously? yes The lisp snippet creates new functions each time the addn function is called, so one can interleave calls to the individual functions. In [21]: a = addn(4) In [22]: b = addn(5) In [23]: c = addn(25) In [24]: a(1) Out[24]: 5 In [25]: b(1) Out[25]: 6 In [26]: c(1) Out[26]: 26 -- Valentino Volonghi aka Dialtone Now Running MacOSX 10.3.8 Blog: http://vvolonghi.blogspot.com http://weever.berlios.de -- http://mail.python.org/mailman/listinfo/python-list
Re: Python becoming less Lisp-like
Bruno Desthuilliers [EMAIL PROTECTED] wrote: It is actually. Ruby's syntax is mostly consistent and coherent, and there is much less special cases than in Python. I'd be glad to know which special cases are you referring to. Please note that you wrote much less which means there are probably so many that you weren't able to count them. -- Valentino Volonghi aka Dialtone Now Running MacOSX 10.3.8 Blog: http://vvolonghi.blogspot.com http://weever.berlios.de -- http://mail.python.org/mailman/listinfo/python-list
Re: Python and Ajax technology collaboration
Chris [EMAIL PROTECTED] wrote: Does anyone else have any Nevow examples? Nevow SVN is full of examples ranging from a simple hello world to a complete blog engine with xml-rpc, smtp and web interfaces for adding new posts and an atom feed, or even a live chat or a pastebin or an image uploader and so on. -- Valentino Volonghi aka Dialtone Now Running MacOSX 10.3.8 Blog: http://vvolonghi.blogspot.com http://weever.berlios.de -- http://mail.python.org/mailman/listinfo/python-list
Re: re-entrancy question
Tim Golden [EMAIL PROTECTED] wrote: No doubt there are more pertinent answers, but unless this is a learning exercise, you'd be better off investigating Pyro: http://pyro.sf.net AFAIK pyro is just a RPC implementation for python whereas Twisted is a completely different beast that happens to have its own implementation of RPC. How would the OP be better investigating something different, that he probably doesn't even need? Your comment would be pertinent only if it considered Perspective Broker against pyro, and I admit I don't know how they compare. -- Valentino Volonghi aka Dialtone Now Running MacOSX 10.3.7 Blog: http://vvolonghi.blogspot.com http://weever.berlios.de -- http://mail.python.org/mailman/listinfo/python-list
Re: Nevow Tutorial and sample app
[EMAIL PROTECTED] wrote: Can any one redirect me to a good nevow tutorial and/or a an appliction that is niether too big nor too small and can be help in learning nevow. Nevow tutorial with the distrubution is too simple and it You should probably look at all the examples in the latest svn release. I've made some changes on the way examples directory work and now you can run all the examples by just running: twistd -noy examples.tac It will create a local webserver at http://localhost:8080/ with an index of all the examples (in difficulty order) with colored browseable source code and the live example. Plus you can access each sample application's (like the blog engine or the interactive chat server, or the pastebin) source code. Examples should scale well from very simple and basic hello world to very sophisticated ones like the blog engine which uses also xmlrpc and smtp protocols, or live pages like chatola. -- Valentino Volonghi aka Dialtone Now Running MacOSX 10.3.7 Blog: http://vvolonghi.blogspot.com http://weever.berlios.de -- http://mail.python.org/mailman/listinfo/python-list
Re: Continuations Based Web Framework - Seaside.
Paul Rubin http://[EMAIL PROTECTED] wrote: Since Python doesn't have continuations, that would be a bit tricky. Since I've already said Nevow with wolf works the same as borges. The only thing that wouldn't work without continuations is the back button. With greenlet module (from Armin Rigo) also the back button will work. I've also already posted an url to the svn sandbox with a working example inside. -- Valentino Volonghi aka Dialtone Now Running MacOSX 10.3.7 Blog: http://vvolonghi.blogspot.com http://weever.berlios.de -- http://mail.python.org/mailman/listinfo/python-list
Re: Web forum (made by python)
[EMAIL PROTECTED] wrote: Don't see anything in PyPI. Do I have to write everything myself? Gah. I need more beer. I'm writing it in my spare time (which is not enough however). You can find the url in the sign. -- Valentino Volonghi aka Dialtone Now Running MacOSX 10.3.6 Blog: http://vvolonghi.blogspot.com http://developer.berlios.de/projects/weever -- http://mail.python.org/mailman/listinfo/python-list