← Back to team overview

libsurl team mailing list archive

Re: Python function?

 

I still have no idea how to update a PPA, Savvas was doing that. When I tried to read a tutorial, all what I said was "Oh well, that stuff is just too hard for me." I can try again though :P

On 12/25/2009 09:50 PM, Scott Lawrence wrote:
Plugins and scripting are definitely surl's job. Do you have any idea
how annoying it is to implement that stuff in C? :-)

libsurl is lacking the ability to handle titles and keywords and
stuff.  By which I mean, the template API can handle them, but none of
the templates I've written actually do.  That's a big thing I need to
work on for 0.6. The other big thing is documentation (ick).

At one point I thought I saw the beginnings of a debian package for
surl, but as nearly as I can tell, nothing is happening with that.
What's going on?


On 12/25/09, Ahmed Elmahdawy<aa_mahdawy@xxxxxxxxxxx>  wrote:
No, these functions are great and should make CDLL happy.
CDLL doesn't understand C types. For example, a function that returns
SURL will just return an integer in Python. When you pass that to other
functions, it throws an exception because "it expected SURL but got int."

By the way, I think libsurl have almost reached surl apart from several
other services. Plugins (and maybe scripting?) are surl's job, not
libsurl's.

On 12/25/2009 09:29 PM, Scott Lawrence wrote:
I don't know how python's C-interface works yet, but: for version 0.6,
the libsurl API is going to include functions along the lines of
(details to be worked out later)

char *surl_qshort(char *url) // picks a few services, and picks the
shortest resulting URL
char *surl_easy_shorten(char *service, char *url); // for normal people
char *surl_do_shorten(char *service,char *url,char *key,char
*whatever_else) // as specified above.

Any other suggestions?

I plan to have surl using the libsurl API around version 0.8 (of both
- version numbers roughly correspond as of libsurl-0.5).


On 12/25/09, Ahmed Elmahdawy<aa_mahdawy@xxxxxxxxxxx>   wrote:
Looking at libsurl's source code, I've found that it seems almost
impossible for Python's -- or in this case, surl -- CDLL to call it.
What can be done in the future is to implement a simple function that
takes all arguments (url, api key, etc and null for none) and returns
the shortened API.
Here's an example:

char *surl_pyget(char *url, char *service, char *key, /more args/)
{
/// do surl_getopt()'s, null or empty string=ignore/
       char *shortUrl = /shortened url/;
       // /cleanup/
       return shortUrl;
}

Regards,
Ahmed Elmahdawy











Follow ups

References