urllib2.URLError:

2009-03-10 Thread Coonay
i use python2.6


File "C:\PROGRA~1\Python26\lib\urllib2.py", line 383, in open
response = self._open(req, data)
  File "C:\PROGRA~1\Python26\lib\urllib2.py", line 401, in _open
'_open', req)
  File "C:\PROGRA~1\Python26\lib\urllib2.py", line 361, in
_call_chain
result = func(*args)
  File "C:\PROGRA~1\Python26\lib\urllib2.py", line 690, in 
meth(r, proxy, type))
  File "C:\PROGRA~1\Python26\lib\urllib2.py", line 713, in proxy_open
return self.parent.open(req)
  File "C:\PROGRA~1\Python26\lib\urllib2.py", line 383, in open
response = self._open(req, data)
  File "C:\PROGRA~1\Python26\lib\urllib2.py", line 406, in _open
'unknown_open', req)
  File "C:\PROGRA~1\Python26\lib\urllib2.py", line 361, in
_call_chain
result = func(*args)
  File "C:\PROGRA~1\Python26\lib\urllib2.py", line 1163, in
unknown_open
raise URLError('unknown url type: %s' % type)
urllib2.URLError: 
--
http://mail.python.org/mailman/listinfo/python-list


Re: can python import class or module directly from a zip package

2009-03-12 Thread Coonay
On Mar 11, 9:47 pm, Lorenzo  wrote:
> On Mar 10, 2:13 pm, Flank  wrote:
>
> > can python import class or  module directly from  a zip package ,just
> > like jave does from jar package without extracting the class file into
> > directory
>
> > so far as i know ,python module should be unzip to file system in
> > order to use them,
>
> After a little digging/googling, the answer came right from the docs:
>
> http://docs.python.org/library/zipimport.html
>
> I think that this module is just right what you need.
>
> Cheers!

thanks  you 2 guys
--
http://mail.python.org/mailman/listinfo/python-list


Re: urllib2.URLError:

2009-03-12 Thread Coonay
i update via http proxy

cmd>set HTTP_PROXY=http://cache.mycompany.com:3128
cmd>python appcfg.py update myapp


URLError: 
Traceback (most recent call last):
  File "C:\Program Files\Google\google_appengine\appcfg.py", line 60,
in 
run_file(__file__, globals())
  File "C:\Program Files\Google\google_appengine\appcfg.py", line 57,
in run_fil
e
execfile(script_path, globals_)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools
\appcfg.p
y", line 1976, in 
main(sys.argv)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools
\appcfg.p
y", line 1967, in main
result = AppCfgApp(argv).Run()
  File "C:\Program Files\Google\google_appengine\google\appengine\tools
\appcfg.p
y", line 1418, in Run
self.action(self)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools
\appcfg.p
y", line 1879, in __call__
return method()
  File "C:\Program Files\Google\google_appengine\google\appengine\tools
\appcfg.p
y", line 1669, in Update
lambda path: open(os.path.join(basepath, path), "rb"))
  File "C:\Program Files\Google\google_appengine\google\appengine\tools
\appcfg.p
y", line 1213, in DoUpload
missing_files = self.Begin()
  File "C:\Program Files\Google\google_appengine\google\appengine\tools
\appcfg.p
y", line 1009, in Begin
version=self.version, payload=self.config.ToYAML())
  File "C:\Program Files\Google\google_appengine\google\appengine\tools
\appengin
e_rpc.py", line 312, in Send
self._Authenticate()
  File "C:\Program Files\Google\google_appengine\google\appengine\tools
\appengin
e_rpc.py", line 344, in _Authenticate
super(HttpRpcServer, self)._Authenticate()
  File "C:\Program Files\Google\google_appengine\google\appengine\tools
\appengin
e_rpc.py", line 233, in _Authenticate
auth_token = self._GetAuthToken(credentials[0], credentials[1])
  File "C:\Program Files\Google\google_appengine\google\appengine\tools
\appengin
e_rpc.py", line 177, in _GetAuthToken
response = self.opener.open(req)
  File "C:\PROGRA~1\Python26\lib\urllib2.py", line 383, in open
response = self._open(req, data)
  File "C:\PROGRA~1\Python26\lib\urllib2.py", line 401, in _open
'_open', req)
  File "C:\PROGRA~1\Python26\lib\urllib2.py", line 361, in _call_chain
result = func(*args)
  File "C:\PROGRA~1\Python26\lib\urllib2.py", line 1138, in https_open
return self.do_open(httplib.HTTPSConnection, req)
  File "C:\PROGRA~1\Python26\lib\urllib2.py", line 1105, in do_open
raise URLError(err)
urllib2.URLError: 

D:\workspace\python>
















On Mar 11, 4:08 pm, Chris Rebert  wrote:
> On Tue, Mar 10, 2009 at 11:34 PM, Coonay  wrote:
> > i use python2.6
>
> > File "C:\PROGRA~1\Python26\lib\urllib2.py", line 383, in open
> >    response = self._open(req, data)
> >  File "C:\PROGRA~1\Python26\lib\urllib2.py", line 401, in _open
> >    '_open', req)
> >  File "C:\PROGRA~1\Python26\lib\urllib2.py", line 361, in
> > _call_chain
> >    result = func(*args)
> >  File "C:\PROGRA~1\Python26\lib\urllib2.py", line 690, in 
> >    meth(r, proxy, type))
> >  File "C:\PROGRA~1\Python26\lib\urllib2.py", line 713, in proxy_open
> >    return self.parent.open(req)
> >  File "C:\PROGRA~1\Python26\lib\urllib2.py", line 383, in open
> >    response = self._open(req, data)
> >  File "C:\PROGRA~1\Python26\lib\urllib2.py", line 406, in _open
> >    'unknown_open', req)
> >  File "C:\PROGRA~1\Python26\lib\urllib2.py", line 361, in
> > _call_chain
> >    result = func(*args)
> >  File "C:\PROGRA~1\Python26\lib\urllib2.py", line 1163, in
> > unknown_open
> >    raise URLError('unknown url type: %s' % type)
> > urllib2.URLError: 
>
> A. Please include the *entire* traceback, in the future
> B. Please include a snippet of the code you're using, in the future
> C. A bit less curt of a missive would also be appreciated
>
> That all said, judging by the error message, it appears that the URL
> you're trying to open has a double-quote (") as its first character,
> which is obviously not permissible.
> I can't be completely sure however, since you neglected to include the
> entire traceback or any of your actual code.
>
> Cheers,
> Chris
>
> --
> I have a blog:http://blog.rebertia.com

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


Re: how to optimize zipimport

2009-03-25 Thread Coonay
see,the zipimort takes nearly 0.5 second

D 03-25 07:53PM 21.374
Loading __main__
I 03-25 07:53PM 21.455
zipimporter('/base/data/home/apps/coonay/1.332322118600950324/
django.zip', '')
W 03-25 07:53PM 22.046
appengine_django module






On Mar 26, 10:41 am, Coonay  wrote:


> in my mudule ,i import another mudule from a zip ,
>
> when i call  my mudle method,the module in the zip will be import from
> the zip every time,that slow down the operation,
>
> i try to search the some workarodnd or solution but i don't get one,
>
> could you help me ?

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


how to optimize zipimport

2009-03-26 Thread Coonay
in my mudule ,i import another mudule from a zip ,

when i call  my mudle method,the module in the zip will be import from
the zip every time,that slow down the operation,

i try to search the some workarodnd or solution but i don't get one,

could you help me ?
--
http://mail.python.org/mailman/listinfo/python-list


i have to change default tab length in pydev

2009-03-29 Thread Coonay
during last few days, i code python using notepad++ or pydev, the
compiler always complain there is a problem with Indentation,in my
eyes ,there is no Indentation problem at all,because i format the code
to make it comply with python style guide strictly,but after i change
the default tab length ,it works.

why is that?
--
http://mail.python.org/mailman/listinfo/python-list


if there is a return type of a method definition like java does

2009-03-29 Thread Coonay
if there is a return type of a method definition,that would lead to
faster decision to do with the method called,do you think so?
--
http://mail.python.org/mailman/listinfo/python-list


Re: i have to change default tab length in pydev

2009-03-29 Thread Coonay
On Mar 30, 6:13 am, "Rhodri James" 
wrote:
> On Sat, 28 Mar 2009 11:30:36 -, Coonay  wrote:
> > during last few days, i code python using notepad++ or pydev, the
> > compiler always complain there is a problem with Indentation,in my
> > eyes ,there is no Indentation problem at all,because i format the code
> > to make it comply with python style guide strictly,but after i change
> > the default tab length ,it works.
>
> If you're mixing tabs and spaces, which from your description you are,
> then you aren't complying strictly with the Python style guide.  PEP 8
> says:
>
> """
> Tabs or Spaces?
>
>     Never mix tabs and spaces.
> """
>
> Clearly the compiler was considering tabs to be a different width to
> your editor's initial setting.  Where you saw:
>
>          Line starting with 8 spaces
>          Line starting with a tab
>
> in the editor window, the compiler instead saw:
>
>          Line starting with 8 spaces
>      Line starting with a tab
>
> or something like that.  Running with "python -t" will warn you about
> this sort of thing.
>
> --
> Rhodri James *-* Wildebeeste Herder to the Masses
i understand that you get request token,and you need to get Access
tokens after that,
my question is about Access tokens:which mechanism  do u use to tore
access tokens for future use
--
http://mail.python.org/mailman/listinfo/python-list


Re: how to optimize zipimport

2009-03-30 Thread Coonay
On Mar 26, 1:38 pm, John Machin  wrote:
> On Mar 26, 2:06 pm, Coonay  wrote:
>
> > see,the zipimort takes nearly 0.5 second
>
> > D 03-25 07:53PM 21.374
> > Loading __main__
> > I 03-25 07:53PM 21.455
> > zipimporter('/base/data/home/apps/coonay/1.332322118600950324/
> > django.zip', '')
>
> ?? zipimport.Zipimporter() has one arg, not two.
>
> > W 03-25 07:53PM 22.046
> > appengine_django module
>
> > On Mar 26, 10:41 am, Coonay  wrote:
>
> > > in my mudule ,i import another mudule from a zip ,
>
> > > when i call  my mudle method,the module in the zip will be import from
> > > the zip every time,that slow down the operation,
>
> > > i try to search the some workarodnd or solution but i don't get one,
>
i don't use zipimport directly,just like u said i put the zip in the
sys.path


> Why are you explicitly using the zipimport module? In other words, why
> don't you put the full path of the zip file in sys.path and then just
> use the normal "import module_in_the_zip" mechanism? Note that this

i found the the module in the zip reloaded  everytime the code is
called,i mean, say ,first time it take me 1 second to call a method in
the zip,but it take another 1 second to call the mothod for another
time ,and so on


> can/should be done once at the top of your calling module. In other
> words, the import code is executed when the calling module is imported
> by your main script, not every time you call a method in your calling
> module.
>
In my developing environment ,there is a limitation of file number
that i can deploy,such as i 'm only allowed to deploy 100 python
files,so i have to zip some module


> Alternatively, if you feel you *must* use zipimport, what's to stop
> you doing that once at the top of the calling module?
>
> Note: it may help when you reply to show a stripped-down version of
> your calling module, sufficient to back up your description of what is
> happening.
>
> HTH,
> John

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


Re: i have to change default tab length in pydev

2009-04-01 Thread Coonay
On Mar 31, 8:39 am, "Rhodri James" 
wrote:
> > i understand that you get request token,and you need to get Access
> > tokens after that,
> > my question is about Access tokens:which mechanism  do u use to tore
> > access tokens for future use
>
> I'm sorry, I have no idea what you're talking about or how it relates
> to bad indent levels.  What *exactly* (including the *whole* traceback)
> is Python saying to you?
>
> --
> Rhodri James *-* Wildebeeste Herder to the Masses
sorry , Rhodri ,i replythe wrong post,As of this my own post,i think
your opnion is reasonable though,but it's still a little wield of
python indentation syntax
--
http://mail.python.org/mailman/listinfo/python-list