Bläddra i källkod

make bean pickleable

version-14
Rushabh Mehta 11 år sedan
förälder
incheckning
19c6dc2d57
5 ändrade filer med 10 tillägg och 6 borttagningar
  1. +4
    -1
      webnotes/__init__.py
  2. +0
    -1
      webnotes/boot.py
  3. +0
    -1
      webnotes/cli.py
  4. +2
    -0
      webnotes/model/doc.py
  5. +4
    -3
      webnotes/webutils.py

+ 4
- 1
webnotes/__init__.py Visa fil

@@ -22,7 +22,10 @@ local = Local()
class _dict(dict):
"""dict like object that exposes keys as attributes"""
def __getattr__(self, key):
return self.get(key)
ret = self.get(key)
if not ret and key.startswith("__"):
raise AttributeError()
return ret
def __setattr__(self, key, value):
self[key] = value
def __getstate__(self):


+ 0
- 1
webnotes/boot.py Visa fil

@@ -69,7 +69,6 @@ def get_bootinfo():
from webnotes.model.utils import compress
bootinfo['docs'] = compress(bootinfo['docs'])

# deal with __slots__ in lang
if bootinfo.lang:
bootinfo.lang = unicode(bootinfo.lang)


+ 0
- 1
webnotes/cli.py Visa fil

@@ -240,7 +240,6 @@ def use():
@cmd
def install(db_name, root_login="root", root_password=None, source_sql=None,
admin_password = 'admin', verbose=True, force=False, site_config=None, reinstall=False):
print db_name, source_sql
from webnotes.installer import install_db, install_app, make_site_dirs
install_db(root_login=root_login, root_password=root_password, db_name=db_name, source_sql=source_sql,
admin_password = admin_password, verbose=verbose, force=force, site_config=site_config, reinstall=reinstall)


+ 2
- 0
webnotes/model/doc.py Visa fil

@@ -178,6 +178,8 @@ class Document:
elif self.fields.has_key(name):
return self.fields[name]
else:
if name.startswith("__"):
raise AttributeError()
return ''
def get(self, name, value=None):


+ 4
- 3
webnotes/webutils.py Visa fil

@@ -86,11 +86,13 @@ def build_page(path):
def get_context(path):
context = None
cache_key = "page_context:{}".format(path)
from pickle import dump
from StringIO import StringIO
# try from memcache
if can_cache():
context = webnotes.cache().get_value(cache_key)
if not context:
context = get_sitemap_options(path)

@@ -99,8 +101,7 @@ def get_context(path):

context = build_context(context)

if can_cache(context.no_cache):
del context["access"]
if can_cache(context.no_cache):
webnotes.cache().set_value(cache_key, context)

else:


Laddar…
Avbryt
Spara