help you download youtube videos in any format and watch later

2014-12-01 Thread marishjaskitons
I suppose the possibilities of Youtube Downloader Application are really
exciting. We get along like oil and water. This begs the question, because
of this, Free Youtube Downloader for Android still uses it today. I may have
to reveal that I dislike Youtube Downloader for Android software. It may
sound odd but I have found that using it is by far the easiest element for
most bums. Apparently, "Jack of all trades, master of none." You might find
a designer Youtube Downloader for Android at a Youtube Downloader for
Android store. Youtube Downloader Application was a dull shock. 

Free Youtube Downloader for Android has achieved heroic status. I am
actually sharing the whole Free Youtube Downloader for Android story. We
need to be the keepers of our own Free Youtube Downloader for Android.
Apparently I was wrong in respect to, Free Youtube Downloader for Android.
Let's look at both sides of this coin. 

http://sourceforge.net/projects/youtube-downloader-android/




--
View this message in context: 
http://python.6.x6.nabble.com/help-you-download-youtube-videos-in-any-format-and-watch-later-tp5079381.html
Sent from the Python - python-list mailing list archive at Nabble.com.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and GUI development

2014-12-01 Thread Michael Torrie
On 12/01/2014 08:49 PM, Ganesh Pal wrote:
> Thanks for the bunch of suggestion , I have decided to go with PYQt  for
> now  : )

If the licensing of PyQt is not appropriate for you (it's GPL only,
unless you buy a license), you can use PySide, which is almost a drop-in
replacement for it, that's licensed more liberally under the LGPL which
does allow its use in a non-GPL program.  Not sure if this matters to
you, but if you're planning to release your code ever, or sell a product
some day, you'll need to be aware of this.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and GUI development

2014-12-01 Thread Ganesh Pal
Thanks for the bunch of suggestion , I have decided to go with PYQt  for
now  : )

On Tue, Dec 2, 2014 at 4:13 AM, Rod Person  wrote:

> On Mon, 1 Dec 2014 23:13:32 +1100
> Chris Angelico  wrote:
>
> > On Mon, Dec 1, 2014 at 10:55 PM, Ganesh Pal 
> > wrote:
> > > Hi folks,
> > >
> > > I want to design a GUI interface for my project . I wanted it to
> > > use it Python and it has to work on freebsd .   Please
> > > provide me the latest trends for GUI development with python.
> > >
> > > Regard s
> > > Ganesh
> >
> > There are lots of Python GUI toolkits. You can use GTK with
> > PyGObject, or PyQt, or wxPython, or Tkinter, or any of quite a few
> > lesser-known ones. You could do a quick web search to find out
> > which ones work on FreeBSD (probably all, or at least most, of
> > them), and then you could find out something about each one, and
> > make a decision based on that.
> >
> > ChrisA
>
> All of the above mentioned work on FreeBSD as I used all to some
> extent for GUI Apps on FreeBSD.
>
> I would say the easiest for a newbie would be PyQt for the fact that
> you can use the Eric IDE (http://www.freshports.org/devel/eric4/)
> which will install the QtDesigner which makes designing GUIs easier.
>
> --
> Rod
>
> http://www.rodperson.com
>
> He who knows himself to be one way and pretends it is another way is a
> thief who robs his own soul.
>
>   The Mahabharata
>  Sakuntala 25
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Cherrypy - prevent browser "prefetch"?

2014-12-01 Thread Tim Chase
On 2014-12-01 13:14, Israel Brewster wrote:
> On Dec 1, 2014, at 12:50 PM, Ned Batchelder 
>> The way to indicate to a browser that it shouldn't pre-fetch a
>> URL is to make it a POST request.
> 
> Ok, that makes sense. The only difficulty I have with that answer
> is that to the best of my knowledge the only way to make a HTML
> link do a POST is to use the onclick function to run a javascript,
> while having the "link" itself point to nothing.

Well, generally one would use a form where the method=POST and then
the button/input submits it:

 
  This is an input
 

or

 
  This is a button
 

The advantage of a  is that it can contain rich content
(other markup) while an  can't.

To do a POST via an  tag, you do need (as you mention) to do some
ugly jiggery with JavaScript, but tends to break the mental model.
You should be able to style a  element to look much like a
link if you find the visual effect of a  unpleasant.

-tkc


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How about some syntactic sugar for " __name__ == '__main__' "?

2014-12-01 Thread Chris Angelico
On Tue, Dec 2, 2014 at 11:45 AM, Ethan Furman  wrote:
> Put the above somewhere in your path (e.g. /usr/local/bin), make it 
> executable, and then instead of shebanging your
> scripts with `/usr/local/bin/python` you can use `/usr/local/bin/py_main`, 
> which will load and execute the script,
> calling script.main as its last act.

Be aware that this trick (shebanging to a script rather than a binary)
isn't specified by the POSIX standard. It works on Linux, but I don't
know about other systems. It's a great trick, though. I once had
shebangs chained something like three or four levels deep.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How about some syntactic sugar for " __name__ == '__main__' "?

2014-12-01 Thread Ethan Furman
On 12/01/2014 03:19 PM, Ethan Furman wrote:
> 
> Well, I've tried this out, and it's only okay.  As soon as interesting things 
> start happening, spurious errors about 
> thread IDs start printing, which really messes up the user experience [...]

So here's another thought:  Have a small python script that loads and runs the 
actual script -- here's a POC:

--- 8< py_main --
#!/usr/bin/env python

import sys
sys.argv.pop(0)

try:
execfile
except NameError:
def execfile(file_name, globals):
with open(file_name) as fh:
script = fh.read()
exec(fh, globals)

module = {}
execfile(sys.argv[0], module)
module['main']()
-

Put the above somewhere in your path (e.g. /usr/local/bin), make it executable, 
and then instead of shebanging your
scripts with `/usr/local/bin/python` you can use `/usr/local/bin/py_main`, 
which will load and execute the script,
calling script.main as its last act.

--
~Ethan~



signature.asc
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How about some syntactic sugar for " __name__ == '__main__' "?

2014-12-01 Thread Ethan Furman
On 11/13/2014 10:32 AM, Ethan Furman wrote:
> On 11/12/2014 01:51 PM, Ian Kelly wrote:
>> On Wed, Nov 12, 2014 at 2:33 PM, Chris Kaynor wrote:
>>>
>>> A decorator is an interesting idea, and should be easy to implement (only
>>> lightly tested):
>>>
>>> def main(func):
>>>  if func.__module__ == "__main__":
>>>  func()
>>>  return func # The return could be omitted to block the function from
>>> being manually called after import.
>>
>> This calls it at the wrong time, though.  [...]
> 
> One decorator that won't call too early is atexit.register().

Well, I've tried this out, and it's only okay.  As soon as interesting things 
start happening, spurious errors about
thread IDs start printing, which really messes up the user experience [1].


[1] something like Exception KeyError: KeyError(139924387112272,) in  ignored

--
~Ethan~



signature.asc
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ssl error with the python mac binary

2014-12-01 Thread Paul Wiseman
On 1 December 2014 at 22:59, Ned Deily  wrote:

> In article
> ,
>  Paul Wiseman  wrote:
> > I just gave 2.7.9rc1 a go and seems like it is still linked to the same
> > version of openssl?
>
> Yes, it still is for rc1.  Unfortunately, I was not able to get
> everything done in time for rc1 and I didn't want to hold up rc1's
> release as there are a lot of other changes that need exposure.  The
> final release installer *will* have the new version of openssl.
>
>
Awesome thanks Ned! look forward to it :)


> --
>  Ned Deily,
>  n...@acm.org
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ssl error with the python mac binary

2014-12-01 Thread Ned Deily
In article 
,
 Paul Wiseman  wrote:
> I just gave 2.7.9rc1 a go and seems like it is still linked to the same
> version of openssl?

Yes, it still is for rc1.  Unfortunately, I was not able to get 
everything done in time for rc1 and I didn't want to hold up rc1's 
release as there are a lot of other changes that need exposure.  The 
final release installer *will* have the new version of openssl.

-- 
 Ned Deily,
 n...@acm.org

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and GUI development

2014-12-01 Thread Rod Person
On Mon, 1 Dec 2014 23:13:32 +1100
Chris Angelico  wrote:

> On Mon, Dec 1, 2014 at 10:55 PM, Ganesh Pal 
> wrote:
> > Hi folks,
> >
> > I want to design a GUI interface for my project . I wanted it to
> > use it Python and it has to work on freebsd .   Please
> > provide me the latest trends for GUI development with python.
> >
> > Regard s
> > Ganesh
> 
> There are lots of Python GUI toolkits. You can use GTK with
> PyGObject, or PyQt, or wxPython, or Tkinter, or any of quite a few
> lesser-known ones. You could do a quick web search to find out
> which ones work on FreeBSD (probably all, or at least most, of
> them), and then you could find out something about each one, and
> make a decision based on that.
> 
> ChrisA

All of the above mentioned work on FreeBSD as I used all to some
extent for GUI Apps on FreeBSD.

I would say the easiest for a newbie would be PyQt for the fact that
you can use the Eric IDE (http://www.freshports.org/devel/eric4/)
which will install the QtDesigner which makes designing GUIs easier.

-- 
Rod

http://www.rodperson.com

He who knows himself to be one way and pretends it is another way is a
thief who robs his own soul.

  The Mahabharata
 Sakuntala 25
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Cherrypy - prevent browser "prefetch"?

2014-12-01 Thread Israel Brewster
On Dec 1, 2014, at 1:12 PM, Tim Chase  wrote:

> On 2014-12-01 16:50, Ned Batchelder wrote:
>> On 12/1/14 4:26 PM, Tim Chase wrote:
>>> All this to also say that performing non-idempotent actions on a
>>> GET request is just begging for trouble. ;-)
>> 
>> This is the key point: your web application shouldn't be doing
>> these kinds of actions in response to a GET request.  Make them
>> POST requests, and Safari won't give you any trouble.
> 
> Though to be fair, based on the reading I did, Safari also pulls in
> the various JS and executes it too, meaning that merely
> (pre)"viewing" the page triggers any Google Analytics (or other
> analytics) code you have on that page, sending "page views" with a
> high bounce rate (looks like you only hit one page and never browsed
> elsewhere on the site).
> 
> Additionally, if the target GET URL involves high processing load on
> the server, it might be worthwhile to put a caching proxy in front of
> it to serve (semi)stale data for any preview request rather than
> impose additional load on the server just so a preview can be updated.

Right, and there are probably some URL's in my app where this may be the case - 
I still need to go back and audit the code now that I'm aware of this going on. 
In general, though, it does sound as though changing things to POST requests, 
and disallowing GET requests for those URLS in my CherryPy app is the way to go.

Thanks!

> 
> So I can see at least two cases in which you might want to sniff the
> "are you just previewing, or do you actually want the page"
> information.  Perhaps there are more.
> 
> -tkc
> 
> 
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

---
Israel Brewster
Systems Analyst II
Ravn Alaska
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7293
---

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Cherrypy - prevent browser "prefetch"?

2014-12-01 Thread Israel Brewster
On Dec 1, 2014, at 12:50 PM, Ned Batchelder  wrote:

> On 12/1/14 4:26 PM, Tim Chase wrote:
>> On 2014-12-01 11:28, Israel Brewster wrote:
>>> I don't know if this is a cherrypy specific question (although it
>>> will be implemented in cherrypy for sure), or more of a general
>>> http protocol question, but when using cherrypy to serve a web app,
>>> is there anyway to prevent browser prefetch? I'm running to a
>>> problem, specifically from Safari on the Mac, where I start to type
>>> a URL, and Safari auto-fills the rest of a random URL matching what
>>> I started to type, and simultaneously sends a request for that URL
>>> to my server, occasionally causing unwanted effects.
>> 
>> All this to also say that performing non-idempotent actions on a GET
>> request is just begging for trouble. ;-)
>> 
> 
> This is the key point: your web application shouldn't be doing these kinds of 
> actions in response to a GET request.  Make them POST requests, and Safari 
> won't give you any trouble.
> 
> Trying to stop Safari from making the GET requests might work for Safari, but 
> then you will find another browser, or a proxy server, or an edge-caching 
> accelerator, etc, that makes the GET requests when you don't want them.
> 
> The way to indicate to a browser that it shouldn't pre-fetch a URL is to make 
> it a POST request.

Ok, that makes sense. The only difficulty I have with that answer is that to 
the best of my knowledge the only way to make a HTML link do a POST is to use 
the onclick function to run a javascript, while having the "link" itself point 
to nothing. Just feels a bit ugly to me, but if that's the Right Way™ to do it, 
then that's fine.

Thanks!

> 
> -- 
> Ned Batchelder, http://nedbatchelder.com
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list


---
Israel Brewster
Systems Analyst II
Ravn Alaska
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7293
---

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Cherrypy - prevent browser "prefetch"?

2014-12-01 Thread Tim Chase
On 2014-12-01 16:50, Ned Batchelder wrote:
> On 12/1/14 4:26 PM, Tim Chase wrote:
>> All this to also say that performing non-idempotent actions on a
>> GET request is just begging for trouble. ;-)
> 
> This is the key point: your web application shouldn't be doing
> these kinds of actions in response to a GET request.  Make them
> POST requests, and Safari won't give you any trouble.

Though to be fair, based on the reading I did, Safari also pulls in
the various JS and executes it too, meaning that merely
(pre)"viewing" the page triggers any Google Analytics (or other
analytics) code you have on that page, sending "page views" with a
high bounce rate (looks like you only hit one page and never browsed
elsewhere on the site).

Additionally, if the target GET URL involves high processing load on
the server, it might be worthwhile to put a caching proxy in front of
it to serve (semi)stale data for any preview request rather than
impose additional load on the server just so a preview can be updated.

So I can see at least two cases in which you might want to sniff the
"are you just previewing, or do you actually want the page"
information.  Perhaps there are more.

-tkc



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Cherrypy - prevent browser "prefetch"?

2014-12-01 Thread Tim Chase
On 2014-12-01 22:44, Christoph M. Becker wrote:
> Tim Chase wrote:
> > haven't investigated recently, but I remember Django's ability to
> > trigger a log-out merely via a GET was something that irked me.
> > 
> > All this to also say that performing non-idempotent actions on a
> > GET request is just begging for trouble. ;-)
> 
> ACK.  However, isn't log-out an idempotent action?

A minor note here...the OP talked about CherryPy and I've been in
Django-land too long that I started talking Django.  I'd have
to pick open the scabs of my CherryPy experience to answer about CP.

But yes, it appears that Django's contrib.auth module still allows
for performing a logout/ on a GET (something I remember
encountering/researching several years ago) rather than limiting it to
a POST. As best I can tell, it doesn't even check the refer(r)er, so
this charmingly means that I can put a tag like

 http://yoursite.example.com/logout/";> 

on *my* site, and it will log you out from yoursite.example.com
despite.  Not even a CSRF-token check because it's not a POST.

-tkc



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Cherrypy - prevent browser "prefetch"?

2014-12-01 Thread Ned Batchelder

On 12/1/14 4:26 PM, Tim Chase wrote:

On 2014-12-01 11:28, Israel Brewster wrote:

I don't know if this is a cherrypy specific question (although it
will be implemented in cherrypy for sure), or more of a general
http protocol question, but when using cherrypy to serve a web app,
is there anyway to prevent browser prefetch? I'm running to a
problem, specifically from Safari on the Mac, where I start to type
a URL, and Safari auto-fills the rest of a random URL matching what
I started to type, and simultaneously sends a request for that URL
to my server, occasionally causing unwanted effects.


All this to also say that performing non-idempotent actions on a GET
request is just begging for trouble. ;-)



This is the key point: your web application shouldn't be doing these 
kinds of actions in response to a GET request.  Make them POST requests, 
and Safari won't give you any trouble.


Trying to stop Safari from making the GET requests might work for 
Safari, but then you will find another browser, or a proxy server, or an 
edge-caching accelerator, etc, that makes the GET requests when you 
don't want them.


The way to indicate to a browser that it shouldn't pre-fetch a URL is to 
make it a POST request.


--
Ned Batchelder, http://nedbatchelder.com

--
https://mail.python.org/mailman/listinfo/python-list


Re: Cherrypy - prevent browser "prefetch"?

2014-12-01 Thread Christoph M. Becker
Tim Chase wrote:

> I
> haven't investigated recently, but I remember Django's ability to
> trigger a log-out merely via a GET was something that irked me.
> 
> All this to also say that performing non-idempotent actions on a GET
> request is just begging for trouble. ;-)

ACK.  However, isn't log-out an idempotent action?

-- 
Christoph M. Becker

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Cherrypy - prevent browser "prefetch"?

2014-12-01 Thread Tim Chase
On 2014-12-01 11:28, Israel Brewster wrote:
> I don't know if this is a cherrypy specific question (although it
> will be implemented in cherrypy for sure), or more of a general
> http protocol question, but when using cherrypy to serve a web app,
> is there anyway to prevent browser prefetch? I'm running to a
> problem, specifically from Safari on the Mac, where I start to type
> a URL, and Safari auto-fills the rest of a random URL matching what
> I started to type, and simultaneously sends a request for that URL
> to my server, occasionally causing unwanted effects.

This SO post[1] suggests that Firefox sets/sends a

  X-moz: prefetch

header, while Safari and Chrome use the

  X-Purpose: preview

header.  You could create a decorator that sniffs those headers and
reacts accordingly.  Though be aware that, based on my reading,
Safari only sends that X-Purpose header for the base page, not any
referenced assets (JS, CSS, images, etc).

Also, while I can't find any documentation on how Safari/Chrome(ium)
handle it, if your logout/ page sends an HTTP/302 redirect to a final
landing page, Safari/Chrome(ium) may be smart enough to not suggest
(and thus not prefetch) the bounce page, only the landing page.  I
haven't investigated recently, but I remember Django's ability to
trigger a log-out merely via a GET was something that irked me.

I don't have a recent version of Safari (my only Apple machine is a
PPC iBook laptop running 10.4 which no longer receives any updates)
so I can't verify that this header is actually being sent in the case
you describe, but it would be where I'd start hunting.

All this to also say that performing non-idempotent actions on a GET
request is just begging for trouble. ;-)

-tkc

[1]
http://stackoverflow.com/questions/9852257/http-header-to-detect-a-preload-request-by-google-chrome




-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Cherrypy - prevent browser "prefetch"?

2014-12-01 Thread sohcahtoa82
On Monday, December 1, 2014 12:29:04 PM UTC-8, Israel Brewster wrote:
> I don't know if this is a cherrypy specific question (although it will be 
> implemented in cherrypy for sure), or more of a general http protocol 
> question, but when using cherrypy to serve a web app, is there anyway to 
> prevent browser prefetch? I'm running to a problem, specifically from Safari 
> on the Mac, where I start to type a URL, and Safari auto-fills the rest of a 
> random URL matching what I started to type, and simultaneously sends a 
> request for that URL to my server, occasionally causing unwanted effects.
> 
> 
> For example, I have a URL on my Cherrypy app that updates some local caches. 
> It is accessed at http:///admin/updatecaches So if I start typing 
> http:///a, for example, safari may auto-fill the "dmin/updatecaches", 
> and trigger a cache refresh on the server - even though I was just trying to 
> get to the main admin page at /admin. Or, it might auto-fill "uth/logout" 
> instead (http:///auth/logout), and log me out of my session. While 
> the former may be acceptable (after all, a cache update, even if not strictly 
> needed, is at least non-harmfull), the latter could cause serious issues with 
> usability. So how can cherrypy tell the difference between the "prefetch" and 
> an actual request, and not respond to the prefetch?
> 
> 
> 
> 
> 
> ---
> 
> Israel Brewster
> 
> Systems Analyst II
> 
> Ravn Alaska
> 
> 5245 Airport Industrial Rd
> 
> Fairbanks, AK 99709
> 
> (907) 450-7293
> 
> ---

That sounds like a seriously misbehaving client to me.  Your browser should not 
be sending requests until the user actually chooses a URL to open.

The only thing I would suggest is to check the HTTP request headers 
(cherrypy.request.headers) of a genuine request versus one made by the 
automatic URL completion.  If there are different headers, such as maybe an 
"X-Prefetch: True" or something, you could check for that.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and GUI development

2014-12-01 Thread Ben Finney
Ganesh Pal  writes:

> I want to design a GUI interface for my project . I wanted it to use it
> Python and it has to work on freebsd .   Please provide me the latest
> trends for GUI development with python.

A good starting point https://wiki.python.org/moin/GuiProgramming>.

-- 
 \   “Truth is stranger than fiction, but it is because fiction is |
  `\ obliged to stick to possibilities, truth isn't.” —Mark Twain, |
_o__)  _Following the Equator_ |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list


Cherrypy - prevent browser "prefetch"?

2014-12-01 Thread Israel Brewster
I don't know if this is a cherrypy specific question (although it will be implemented in cherrypy for sure), or more of a general http protocol question, but when using cherrypy to serve a web app, is there anyway to prevent browser prefetch? I'm running to a problem, specifically from Safari on the Mac, where I start to type a URL, and Safari auto-fills the rest of a random URL matching what I started to type, and simultaneously sends a request for that URL to my server, occasionally causing unwanted effects.For example, I have a URL on my Cherrypy app that updates some local caches. It is accessed at http:///admin/updatecaches So if I start typing http:///a, for example, safari may auto-fill the "dmin/updatecaches", and trigger a cache refresh on the server - even though I was just trying to get to the main admin page at /admin. Or, it might auto-fill "uth/logout" instead (http:///auth/logout), and log me out of my session. While the former may be acceptable (after all, a cache update, even if not strictly needed, is at least non-harmfull), the latter could cause serious issues with usability. So how can cherrypy tell the difference between the "prefetch" and an actual request, and not respond to the prefetch?
---Israel BrewsterSystems Analyst IIRavn Alaska5245 Airport Industrial RdFairbanks, AK 99709(907) 450-7293---BEGIN:VCARD
VERSION:3.0
N:Brewster;Israel;;;
FN:Israel Brewster
ORG:Frontier Flying Service;MIS
TITLE:PC Support Tech II
EMAIL;type=INTERNET;type=WORK;type=pref:isr...@frontierflying.com
TEL;type=WORK;type=pref:907-450-7293
item1.ADR;type=WORK;type=pref:;;5245 Airport Industrial Wy;Fairbanks;AK;99701;
item1.X-ABADR:us
CATEGORIES:General
X-ABUID:36305438-95EA-4410-91AB-45D16CABCDDC\:ABPerson
END:VCARD


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and GUI development

2014-12-01 Thread Patrick Stinson
I’ve been using PyQt for 10 years. Absolutely fabulous, fun, and I imagine the 
others are also excellent as they have all been around long enough to die 
naturally if they were not very useful.


> On Dec 1, 2014, at 3:13 AM, Chris Angelico  wrote:
> 
> On Mon, Dec 1, 2014 at 10:55 PM, Ganesh Pal  wrote:
>> Hi folks,
>> 
>> I want to design a GUI interface for my project . I wanted it to use it
>> Python and it has to work on freebsd .   Please provide me the latest
>> trends for GUI development with python.
>> 
>> Regard s
>> Ganesh
> 
> There are lots of Python GUI toolkits. You can use GTK with PyGObject,
> or PyQt, or wxPython, or Tkinter, or any of quite a few lesser-known
> ones. You could do a quick web search to find out which ones work on
> FreeBSD (probably all, or at least most, of them), and then you could
> find out something about each one, and make a decision based on that.
> 
> ChrisA
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


i have to create this patch in python but wasnt having any luck i was wondering if anyone had a solution?

2014-12-01 Thread python help required
def penultimatePatch():

win = GraphWin("Patch1",(100), 100)
amountOfCircles = 5

#Filled Red Circles
fillCircle = Circle(Point(20,20)+100/amountOfCircles)
fillCircle.draw(win)
fillCircle.setFill("red")

#Verticle white rectangles
rectangleVerticle1 = Rectangle(Point(0,0), Point(10,100))
rectangleVerticle1.setFill("white")
rectangleVerticle1.setOutline("white")
rectangleVerticle1.draw(win)

rectangleVerticle2 = Rectangle(Point(41,0), Point(51,100))
rectangleVerticle2.setFill("white")
rectangleVerticle2.setOutline("white")
rectangleVerticle2.draw(win)

rectangleVerticle3 = Rectangle(Point(81,0), Point(91,100))
rectangleVerticle3.setFill("white")
rectangleVerticle3.setOutline("white")
rectangleVerticle3.draw(win)

#Horizontal white rectangles 
rectangleHorizontal = Rectangle(Point(21,11), Point(41,21))
rectangleHorizontal.setFill("white")
rectangleHorizontal.setOutline("white")
rectangleHorizontal.draw(win)

rectangleHorizontal = Rectangle(Point(61,11), Point(81,21))
rectangleHorizontal.setFill("white")
rectangleHorizontal.setOutline("white")
rectangleHorizontal.draw(win)

rectangleHorizontal = Rectangle(Point(21,31), Point(51,41))
rectangleHorizontal.setFill("white")
rectangleHorizontal.setOutline("white")
rectangleHorizontal.draw(win)

rectangleHorizontal = Rectangle(Point(81,31), Point(61,41))
rectangleHorizontal.setFill("white")
rectangleHorizontal.setOutline("white")
rectangleHorizontal.draw(win)

rectangleHorizontal = Rectangle(Point(21,51), Point(51,61))
rectangleHorizontal.setFill("white")
rectangleHorizontal.setOutline("white")
rectangleHorizontal.draw(win)

rectangleHorizontal = Rectangle(Point(61,51), Point(91,61))
rectangleHorizontal.setFill("white")
rectangleHorizontal.setOutline("white")
rectangleHorizontal.draw(win)

rectangleHorizontal = Rectangle(Point(21,71), Point(51,81))
rectangleHorizontal.setFill("white")
rectangleHorizontal.setOutline("white")
rectangleHorizontal.draw(win)

rectangleHorizontal = Rectangle(Point(61,71), Point(81,81))
rectangleHorizontal.setFill("white")
rectangleHorizontal.setOutline("white")
rectangleHorizontal.draw(win)

rectangleHorizontal = Rectangle(Point(21,91), Point(51,100))
rectangleHorizontal.setFill("white")
rectangleHorizontal.setOutline("white")
rectangleHorizontal.draw(win)

rectangleHorizontal = Rectangle(Point(61,91), Point(91,100))
rectangleHorizontal.setFill("white")
rectangleHorizontal.setOutline("white")
rectangleHorizontal.draw(win)

#Outlined Red circles
fillCircle = Circle(Point(20,20)+100/amountOfCircles)
fillCircle.draw(win)
fillCircle.setOutline("red")

it is supposed to create this design>>> http://i.stack.imgur.com/2dfGi.jpg
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Invalid Syntax Installing pip - ez_setup.py

2014-12-01 Thread Billy Furlong
Success.

Whats happening is that the second wget command is not recognizing the 
--no-check-certificate.  So I went around the problem and installed it manually.

wget https://pypi.python.org/packages/source/s/setuptools/setuptools-7.0.zip 
--no-check-certificate
unzip setuptools-7.0.zip
python2.7 setup.py install
easy_install pip

I'm good.  Pip is installed.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Need Help

2014-12-01 Thread Fabio Zadrozny
On Mon, Dec 1, 2014 at 11:05 AM, Ezhilarasan Chandrasekar <
aezhi...@gmail.com> wrote:

> Hi Guys,
>
> I'm a beginner of python, I just want your help.
>
> I'm using the Python in Pydev - Eclipse.
>
> How can I get the Failure values from the Console in to a txt or a csv
> file?
>
> And how can I get the final result of the TC (lets say, OK or FAIL or
> ERROR)?
>
> So that If I'm working with 1000 Test cases, I can easily find out the
> Failed TCs and work on them.
>
> Please find my above questions and revert me with a good answer.
>
>
Well, you want that to work/rerun the failed tests, PyDev does have a
unittest-integration view which shows failed tests. Just run the tests
right-clicking a folder -> run tests and the view should show the results
(and it provides a way to show only failed tests, rerun only failures, see
output, etc) -- see: http://pydev.org/manual_adv_pyunit.html

The only thing is that it doesn't export that to a file... if you want to
have that as an exported file, my suggestion would be using nose or pytest
(which can also be used as the runners inside of PyDev --
http://pydev.org/manual_adv_pyunit.html also has more details on that) and
pass a xml dump file (which I think both support).

Cheers,

Fabio
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Setting default_factory of defaultdict to key

2014-12-01 Thread Ian Kelly
On Mon, Dec 1, 2014 at 11:29 AM, Larry Martell  wrote:
> I spoke too soon:
>
 class defaultdictkey(defaultdict):
> ...  def __missing__(self, key):
> ...   self[key] = self.default_factory(key)
> ...
 x = defaultdictkey(lambda k: k)
 print x['aaa']
> None
 print x['aaa']
> aaa
 a = x['qqq']
 print a
> None

You need to also return the value from __missing__.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Setting default_factory of defaultdict to key

2014-12-01 Thread Larry Martell
On Mon, Dec 1, 2014 at 1:36 PM, Ethan Furman  wrote:
> On 12/01/2014 10:29 AM, Larry Martell wrote:
>> On Mon, Dec 1, 2014 at 1:19 PM, Ethan Furman  wrote:
>>> On 12/01/2014 10:05 AM, Larry Martell wrote:

 Is there a way to set the default_factory of defaultdict so that
 accesses to undefined keys get to set to the key?
>>>
>>> You need to subclass and modify __missing__ to actually pass along the key:
>>>
>>> --> class defaultdictkey(defaultdict):
>>> ...   def __missing__(self, key):
>>> ... self[key] = self.default_factory(key)
>>> ... return self[key]
>>> ...
>>>
>>> and in action:
>>>
>>> --> huh = defaultdictkey(lambda k: k)
>>> --> huh
>>> defaultdict( at 0x7fe1305de3f0>, {})
>>> --> huh['x']
>>> 'x'
>>> --> huh['x']
>>> 'x'
>>> --> huh.get('y')
>>> --> huh['y']
>>> 'y'
>>> --> huh.get('y')
>>> 'y'
>>
>>
>> I spoke too soon:
>>
> class defaultdictkey(defaultdict):
>> ...  def __missing__(self, key):
>> ...   self[key] = self.default_factory(key)
>
> You missed the third line here ^
>
>   ...   return self[key]

Oops! Thanks. Working now.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Setting default_factory of defaultdict to key

2014-12-01 Thread Ethan Furman
On 12/01/2014 10:29 AM, Larry Martell wrote:
> On Mon, Dec 1, 2014 at 1:19 PM, Ethan Furman  wrote:
>> On 12/01/2014 10:05 AM, Larry Martell wrote:
>>>
>>> Is there a way to set the default_factory of defaultdict so that
>>> accesses to undefined keys get to set to the key?
>>
>> You need to subclass and modify __missing__ to actually pass along the key:
>>
>> --> class defaultdictkey(defaultdict):
>> ...   def __missing__(self, key):
>> ... self[key] = self.default_factory(key)
>> ... return self[key]
>> ...
>>
>> and in action:
>>
>> --> huh = defaultdictkey(lambda k: k)
>> --> huh
>> defaultdict( at 0x7fe1305de3f0>, {})
>> --> huh['x']
>> 'x'
>> --> huh['x']
>> 'x'
>> --> huh.get('y')
>> --> huh['y']
>> 'y'
>> --> huh.get('y')
>> 'y'
> 
> 
> I spoke too soon:
> 
 class defaultdictkey(defaultdict):
> ...  def __missing__(self, key):
> ...   self[key] = self.default_factory(key)

You missed the third line here ^

  ...   return self[key]

--
~Ethan~



signature.asc
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Setting default_factory of defaultdict to key

2014-12-01 Thread Tim Chase
On 2014-12-01 13:05, Larry Martell wrote:
> Is there a way to set the default_factory of defaultdict so that
> accesses to undefined keys get to set to the key?
> 
> i.e. if d['xxx'] were accessed and there was no key 'xxx' then
> d['xxx'] would get set to 'xxx'
> 
> I know I can define a function with lambda for the default_factory,
> but I don't see how to access the key. I tried:
> 
> d = defaultdict(lambda: key)

You could subclass it:

  class MyDefaultDict(defaultdict):
def __missing__(self, key):
  #self[key] = key  # if you actually want it in the dict
  return key


You might also have to override the __contains__ method to always
return True if you want

  value_not_in_dict = 42
  my_default_dict = MyDefaultDict(int)
  if value_not_in_dict in my_default_dict:
this_branch_would_always_happen()
  else:
this_branch_should_never_happen

You'd also have weird behaviors with iterators as they'd only ever
iterate over things that were in the dict.

-tkc


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Setting default_factory of defaultdict to key

2014-12-01 Thread Larry Martell
On Mon, Dec 1, 2014 at 1:19 PM, Ethan Furman  wrote:
> On 12/01/2014 10:05 AM, Larry Martell wrote:
>>
>> Is there a way to set the default_factory of defaultdict so that
>> accesses to undefined keys get to set to the key?
>
> You need to subclass and modify __missing__ to actually pass along the key:
>
> --> class defaultdictkey(defaultdict):
> ...   def __missing__(self, key):
> ... self[key] = self.default_factory(key)
> ... return self[key]
> ...
>
> and in action:
>
> --> huh = defaultdictkey(lambda k: k)
> --> huh
> defaultdict( at 0x7fe1305de3f0>, {})
> --> huh['x']
> 'x'
> --> huh['x']
> 'x'
> --> huh.get('y')
> --> huh['y']
> 'y'
> --> huh.get('y')
> 'y'


I spoke too soon:

>>> class defaultdictkey(defaultdict):
...  def __missing__(self, key):
...   self[key] = self.default_factory(key)
...
>>> x = defaultdictkey(lambda k: k)
>>> print x['aaa']
None
>>> print x['aaa']
aaa
>>> a = x['qqq']
>>> print a
None
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Setting default_factory of defaultdict to key

2014-12-01 Thread Larry Martell
On Mon, Dec 1, 2014 at 1:19 PM, Ethan Furman  wrote:
> On 12/01/2014 10:05 AM, Larry Martell wrote:
>>
>> Is there a way to set the default_factory of defaultdict so that
>> accesses to undefined keys get to set to the key?
>
> You need to subclass and modify __missing__ to actually pass along the key:
>
> --> class defaultdictkey(defaultdict):
> ...   def __missing__(self, key):
> ... self[key] = self.default_factory(key)
> ... return self[key]
> ...
>
> and in action:
>
> --> huh = defaultdictkey(lambda k: k)
> --> huh
> defaultdict( at 0x7fe1305de3f0>, {})
> --> huh['x']
> 'x'
> --> huh['x']
> 'x'
> --> huh.get('y')
> --> huh['y']
> 'y'
> --> huh.get('y')
> 'y'

Perfect. Thanks much.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Invalid Syntax Installing pip - ez_setup.py

2014-12-01 Thread Billy Furlong
Hi Chris,

Yep that got me closer.  I found that using | sudo python2.7 was a bad command. 
 So I changed over to | python2.7.


[root@myserver tmp]# wget https://bootstrap.pypa.io/ez_setup.py 
--no-check-certificate -O - | python2.7
--2014-12-01 12:57:07--  https://bootstrap.pypa.io/ez_setup.py
Resolving bootstrap.pypa.io... 23.235.46.175
Connecting to bootstrap.pypa.io|23.235.46.175|:443... connected.
WARNING: certificate common name `*.c.ssl.fastly.net' doesn't match requested 
host name `bootstrap.pypa.io'.
HTTP request sent, awaiting response... 200 OK
Length: 10476 (10K) [text/x-python]
Saving to: `STDOUT'

100%[=>]
 10,476  --.-K/s   in 0s

2014-12-01 12:57:07 (30.8 MB/s) - `-' saved [10476/10476]

Downloading 
https://pypi.python.org/packages/source/s/setuptools/setuptools-7.0.zip
Traceback (most recent call last):
  File "", line 332, in 
  File "", line 327, in main
  File "", line 287, in download_setuptools
  File "", line 224, in download_file_wget
  File "", line 169, in _clean_check
  File "/opt/python2.7/lib/python2.7/subprocess.py", line 542, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['wget', 
'https://pypi.python.org/packages/source/s/setuptools/setuptools-7.0.zip', 
'--quiet', '--output-document', '/tmp/setuptools-7.0.zip']' returned non-zero 
exit status 1


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Setting default_factory of defaultdict to key

2014-12-01 Thread Ethan Furman
On 12/01/2014 10:05 AM, Larry Martell wrote:
>
> Is there a way to set the default_factory of defaultdict so that
> accesses to undefined keys get to set to the key?

You need to subclass and modify __missing__ to actually pass along the key:

--> class defaultdictkey(defaultdict):
...   def __missing__(self, key):
... self[key] = self.default_factory(key)
... return self[key]
...

and in action:

--> huh = defaultdictkey(lambda k: k)
--> huh
defaultdict( at 0x7fe1305de3f0>, {})
--> huh['x']
'x'
--> huh['x']
'x'
--> huh.get('y')
--> huh['y']
'y'
--> huh.get('y')
'y'

--
~Ethan~



signature.asc
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Setting default_factory of defaultdict to key

2014-12-01 Thread Ian Kelly
On Mon, Dec 1, 2014 at 11:05 AM, Larry Martell  wrote:
> Is there a way to set the default_factory of defaultdict so that
> accesses to undefined keys get to set to the key?
>
> i.e. if d['xxx'] were accessed and there was no key 'xxx' then
> d['xxx'] would get set to 'xxx'
>
> I know I can define a function with lambda for the default_factory,
> but I don't see how to access the key. I tried:
>
> d = defaultdict(lambda: key)
>
> But that did not work.

Not with defaultdict, but you can subclass dict and provide a
__missing__ method directly, which is passed the key. This is
basically all that defaultdict does.
-- 
https://mail.python.org/mailman/listinfo/python-list


Setting default_factory of defaultdict to key

2014-12-01 Thread Larry Martell
Is there a way to set the default_factory of defaultdict so that
accesses to undefined keys get to set to the key?

i.e. if d['xxx'] were accessed and there was no key 'xxx' then
d['xxx'] would get set to 'xxx'

I know I can define a function with lambda for the default_factory,
but I don't see how to access the key. I tried:

d = defaultdict(lambda: key)

But that did not work.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Invalid Syntax Installing pip - ez_setup.py

2014-12-01 Thread Chris Angelico
On Tue, Dec 2, 2014 at 3:58 AM,   wrote:
> Getting an error when I try to install ez_setup.py.  I thought that this was 
> an issues with an incorrect version of python, so I upgraded to 2.7.5 
> successfully.  But unfortunately I get the same error.
>
>
>   File "", line 51
> with archive_context(archive_filename):
>^
> SyntaxError: invalid syntax

When you run 'python', you apparently are getting the old version
still. Try 'python2.7' instead.

If you used a bash alias to change the meaning of the word 'python',
that won't work with sudo. But the fuller name should work.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Invalid Syntax Installing pip - ez_setup.py

2014-12-01 Thread billyfurlong
Hi all,

Getting an error when I try to install ez_setup.py.  I thought that this was an 
issues with an incorrect version of python, so I upgraded to 2.7.5 
successfully.  But unfortunately I get the same error.


[root@yyboxname tmp]# wget https://bootstrap.pypa.io/ez_setup.py 
--no-check-certificate -O - | sudo python
--2014-12-01 11:30:17--  https://bootstrap.pypa.io/ez_setup.py
Resolving bootstrap.pypa.io... 23.235.39.175
Connecting to bootstrap.pypa.io|23.235.39.175|:443... connected.
WARNING: certificate common name `*.c.ssl.fastly.net' doesn't match requested 
host name `bootstrap.pypa.io'.
HTTP request sent, awaiting response... 200 OK
Length: 10476 (10K) [text/x-python]
Saving to: `STDOUT'

100%[=>]
 10,476  --.-K/s   in 0s

2014-12-01 11:30:17 (31.4 MB/s) - `-' saved [10476/10476]

  File "", line 51
with archive_context(archive_filename):
   ^
SyntaxError: invalid syntax


Any help or direction would be greatly appreciated.

Billy,
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Issues installing Python 2.7

2014-12-01 Thread Chris Angelico
On Tue, Dec 2, 2014 at 3:40 AM,   wrote:
> This actually worked!!  It's a bare machine with nothing (except the system) 
> using python.

Good to know! But, uhh... *what* actually worked? You've posted with
no content, so we have no idea which of the several suggestions in
this thread worked - and,more importantly, neither does anyone who
comes reading the archive. One of the beauties of a good mailing list
is that information hangs around; if anyone else has the same problem
as you do, s/he can read the response and know what to do, without
waiting for the turn-around time of email questions and answers. For
that to work, context is crucial.

But I'm glad you're sorted out!

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Issues installing Python 2.7

2014-12-01 Thread billyfurlong
This actually worked!!  It's a bare machine with nothing (except the system) 
using python.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Fwd: Need Help

2014-12-01 Thread alister
On Mon, 01 Dec 2014 18:41:27 +0530, Ezhilarasan Chandrasekar wrote:

> Hi Guys,
> 
> I'm a beginner of python, I just want your help.
> 
> I'm using the Python in Pydev - Eclipse.
> 
> How can I get the Failure values from the Console in to a txt or a csv
> file?
> 
> And how can I get the final result of the TC (lets say, OK or FAIL or
> ERROR)?
> 
> So that If I'm working with 1000 Test cases, I can easily find out the
> Failed TCs and work on them.
> 
> Please find my above questions and revert me with a good answer.

if you expect any assistance yopu need to try the fiollowing:-

1) DO NOT keep reposting the same question - it wont get you results any 
faster (it is more likely to antagonise those who may be able to help & 
stop them responding).

2) Post the code you are working with and a full traceback of any errors.

Your problem does not look like a beginner question but something a 
professional would require



-- 
Its the InterNIC's fault.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Read response XML attributes in django rest framework

2014-12-01 Thread Roy Smith
In article <1248a112-88fd-4346-a733-7716671b8...@googlegroups.com>,
 reetesh nigam  wrote:

> I need to read xml attributes coming in response data. I am using Django rest 
> framework.
> 
> requested XML :   startDate="02-02-2014"/>
> 
> Response I am getting: {'xyz': None}
> 
> I am using : 'DEFAULT_PARSER_CLASSES': ('rest_framework.parsers.XMLParser') 
> in my setting.py file

This seems like a question for the django-users mailing list.

https://docs.djangoproject.com/en/1.7/internals/mailing-lists
-- 
https://mail.python.org/mailman/listinfo/python-list


Fwd: Need Help

2014-12-01 Thread Ezhilarasan Chandrasekar
Hi Guys,

I'm a beginner of python, I just want your help.

I'm using the Python in Pydev - Eclipse.

How can I get the Failure values from the Console in to a txt or a csv file?

And how can I get the final result of the TC (lets say, OK or FAIL or
ERROR)?

So that If I'm working with 1000 Test cases, I can easily find out the
Failed TCs and work on them.

Please find my above questions and revert me with a good answer.

--
Warm regards,
Ezhilarasan
-- 
https://mail.python.org/mailman/listinfo/python-list


Need Help

2014-12-01 Thread Ezhilarasan Chandrasekar
Hi Guys,

I'm a beginner of python, I just want your help.

I'm using the Python in Pydev - Eclipse.

How can I get the Failure values from the Console in to a txt or a csv file?

And how can I get the final result of the TC (lets say, OK or FAIL or
ERROR)?

So that If I'm working with 1000 Test cases, I can easily find out the
Failed TCs and work on them.

Please find my above questions and revert me with a good answer.

--
Warm regards,
Ezhilarasan
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and GUI development

2014-12-01 Thread Chris Angelico
On Mon, Dec 1, 2014 at 10:55 PM, Ganesh Pal  wrote:
> Hi folks,
>
> I want to design a GUI interface for my project . I wanted it to use it
> Python and it has to work on freebsd .   Please provide me the latest
> trends for GUI development with python.
>
> Regard s
> Ganesh

There are lots of Python GUI toolkits. You can use GTK with PyGObject,
or PyQt, or wxPython, or Tkinter, or any of quite a few lesser-known
ones. You could do a quick web search to find out which ones work on
FreeBSD (probably all, or at least most, of them), and then you could
find out something about each one, and make a decision based on that.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Python and GUI development

2014-12-01 Thread Ganesh Pal
Hi folks,

I want to design a GUI interface for my project . I wanted it to use it
Python and it has to work on freebsd .   Please provide me the latest
trends for GUI development with python.

Regard s
Ganesh
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ssl error with the python mac binary

2014-12-01 Thread Paul Wiseman
On 10 November 2014 at 22:51, Ned Deily  wrote:

> In article
> ,
>  Paul Wiseman  wrote:
> > I've been using the latest mac ppc/i386 binaries from python.org
> > (https://www.python.org/ftp/python/2.7.8/python-2.7.8-macosx10.5.dmg).
> > From what I can tell this version is linked against a pretty old
> > version of OpenSSL (OpenSSL 0.9.7l 28 Sep 2006) which doesn't seem to
> > be able to handle new sha-256 certificates.
> >
> > For example I'm unable to use pip (I guess the certificate was updated
> > recently)
>
> Yes, the current python.org certificate does seem to cause problems for
> that version of OpenSSL, unfortunately.
>
> > Am I right in thinking this is an issue with the build of python
> > itself? Is there a way I can upgrade the version of OpenSSL linked
> > with python- or force the python build to look elsewhere for the
> > library? Or will I have to build my own from source?
>
> In the Pythons from the python.org OS X installers, the Python _ssl and
> _hashlib extension modules are dynamically linked with the
> system-supplied OpenSSL libraries.  If actually running on OS X 10.5,
> one would have to rebuild _ssl.so and _hashlib.so, linking them with a
> locally-supplied version of a newer OpenSSL, since different versions of
> OpenSSL are not ABI-compatible, e.g. 0.9.7 vs 0.9.8 vs 1.0.1.  If
> running on OS X 10.6 or later, another option might be to install from
> the 64-bit/32-bit installer which is a good idea to do anyway.  For pip
> usage, a workaround would be to manually download distributions from
> PyPI (or elsewhere) using a web browser and then use pip to install from
> the downloaded file.   The next version of pip is expected to have a
> --no-check-certificate option that bypasses the certificate check at the
> cost of reduced security.  For the upcoming Python 2.7.9 release
> (planned for early December), I intend to have the Pythons in the
> python.org OS X installers use their own versions of OpenSSL and thus no
> longer depend on the now-deprecated system OpenSSL.
>
>
I just gave 2.7.9rc1 a go and seems like it is still linked to the same
version of openssl?

Python 2.7.9rc1 (v2.7.9rc1:40eada278702, Nov 25 2014, 17:10:11)
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import requests
>>> requests.get("https://python.org";)
Traceback (most recent call last):
  File "", line 1, in 
  File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests-2.4.3-py2.7.egg/requests/api.py",
line 60, in get
return request('get', url, **kwargs)
  File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests-2.4.3-py2.7.egg/requests/api.py",
line 49, in request
return session.request(method=method, url=url, **kwargs)
  File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests-2.4.3-py2.7.egg/requests/sessions.py",
line 457, in request
resp = self.send(prep, **send_kwargs)
  File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests-2.4.3-py2.7.egg/requests/sessions.py",
line 569, in send
r = adapter.send(request, **kwargs)
  File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests-2.4.3-py2.7.egg/requests/adapters.py",
line 420, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate
verify failed (_ssl.c:581)
>>>
>>> import ssl
>>> ssl.OPENSSL_VERSION
'OpenSSL 0.9.7l 28 Sep 2006'


> --
>  Ned Deily,
>  n...@acm.org
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Read response XML attributes in django rest framework

2014-12-01 Thread reetesh nigam
I need to read xml attributes coming in response data. I am using Django rest 
framework.

requested XML :  

Response I am getting: {'xyz': None}

I am using : 'DEFAULT_PARSER_CLASSES': ('rest_framework.parsers.XMLParser') in 
my setting.py file
-- 
https://mail.python.org/mailman/listinfo/python-list


I need Help

2014-12-01 Thread Ezhilarasan Chandrasekar
Hi Python-list Team,

I'm a beginner of python, I just want your help.

I'm using the Python in Pydev - Eclipse.

How can I get the Failure values from the Console in to a txt or a csv file?

And how can I get the final result of the TC (lets say, OK or FAIL or
ERROR)?

So that If I'm working with 1000 Test cases, I can easily find out the
Failed TCs and work on them.

Please find my above questions and revert me with a good answer.

Thanks in advance,

Ezhilarasan
-- 
https://mail.python.org/mailman/listinfo/python-list