Search Results

Search found 2 results on 1 pages for 'bocco'.

Page 1/1 | 1 

  • Eclipse+PyDev+GAE memcache error

    - by bocco
    I've started using Eclipe+PyDev as an environment for developing my first app for Google App Engine. Eclipse is configured according to this tutorial. Everything was working until I start to use memcache. PyDev reports the errors and I don't know how to fix it: Error: Undefined variable from import: get How to fix this? Sure, it is only PyDev checker problem. Code is correct and run on GAE. UPDATE: I'm using PyDev 1.5.0 but experienced the same with 1.4.8. My PYTHONPATH includes (set in Project Properties/PyDev - PYTHONPATH): C:\Program Files\Google\google_appengine C:\Program Files\Google\google_appengine\lib\django C:\Program Files\Google\google_appengine\lib\webob C:\Program Files\Google\google_appengine\lib\yaml\lib UPDATE 2: I took a look at C:\Program Files\Google\google_appengine\google\appengine\api\memcache\__init__.py and found get() is not declared as memcache module function. They use the following trick to do that (I didn't hear about such possibility): _CLIENT = None def setup_client(client_obj): """Sets the Client object instance to use for all module-level methods. Use this method if you want to have customer persistent_id() or persistent_load() functions associated with your client. Args: client_obj: Instance of the memcache.Client object. """ global _CLIENT var_dict = globals() _CLIENT = client_obj var_dict['set_servers'] = _CLIENT.set_servers var_dict['disconnect_all'] = _CLIENT.disconnect_all var_dict['forget_dead_hosts'] = _CLIENT.forget_dead_hosts var_dict['debuglog'] = _CLIENT.debuglog var_dict['get'] = _CLIENT.get var_dict['get_multi'] = _CLIENT.get_multi var_dict['set'] = _CLIENT.set var_dict['set_multi'] = _CLIENT.set_multi var_dict['add'] = _CLIENT.add var_dict['add_multi'] = _CLIENT.add_multi var_dict['replace'] = _CLIENT.replace var_dict['replace_multi'] = _CLIENT.replace_multi var_dict['delete'] = _CLIENT.delete var_dict['delete_multi'] = _CLIENT.delete_multi var_dict['incr'] = _CLIENT.incr var_dict['decr'] = _CLIENT.decr var_dict['flush_all'] = _CLIENT.flush_all var_dict['get_stats'] = _CLIENT.get_stats setup_client(Client()) Hmm... Any idea how to force PyDev to recognize that?

    Read the article

  • Importing BitTorrent bencode module

    - by bocco
    Hi, I'm on Mac OS X 10.6. Python is 2.6.1. I've installed bencode module as sudo easy_install BitTorrent-bencode It appeared in site-packages /Library/Python/2.6/site-packages/BitTorrent_bencode-5.0.8-py2.6.egg But, how to import and use this module? >>> import bencode doesn't work... Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named bencode How to import modules from site-packages? How to recognize module name BitTorrent_bencode-5.0.8-py2.6.egg contains? Thanks

    Read the article

1