Did I find the right examples for you? yes no Crawl my project Python Jobs
All Samples(504) | Call(325) | Derive(0) | Import(179)
src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/Field.py Products.Archetypes(Download)
from Products.Archetypes.utils import className from Products.Archetypes.utils import mapply from Products.Archetypes.utils import shasattr from Products.Archetypes.utils import contentDispositionHeader from Products.Archetypes.mimetype_utils import getAllowedContentTypes as getAllowedContentTypesProperty
widget.populateProps """ if shasattr(self, 'widget'): if type(self.widget) in (ClassType, type(Base)): self.widget = self.widget()
dm = self.default_method if dm: if isinstance(dm, basestring) and shasattr(instance, dm): method = getattr(instance, dm) return method()
self.unset(instance) self.storage = storage if shasattr(self.storage, 'initializeInstance'): self.storage.initializeInstance(instance) self.set(instance, value)
""" value = '' if fromBaseUnit and shasattr(self, 'getBaseUnit'): bu = self.getBaseUnit(instance) if IBaseUnit.providedBy(bu):
src/p/r/Products.Archetypes-HEAD/Products/Archetypes/Field.py Products.Archetypes(Download)
from Products.Archetypes.utils import className from Products.Archetypes.utils import mapply from Products.Archetypes.utils import shasattr from Products.Archetypes.utils import contentDispositionHeader from Products.Archetypes.mimetype_utils import getAllowedContentTypes as getAllowedContentTypesProperty
widget.populateProps """ if shasattr(self, 'widget'): if type(self.widget) in (ClassType, type(Base)): self.widget = self.widget()
dm = self.default_method if dm: if isinstance(dm, basestring) and shasattr(instance, dm): method = getattr(instance, dm) return method()
self.unset(instance) self.storage = storage if shasattr(self.storage, 'initializeInstance'): self.storage.initializeInstance(instance) self.set(instance, value)
""" value = '' if fromBaseUnit and shasattr(self, 'getBaseUnit'): bu = self.getBaseUnit(instance) if IBaseUnit.providedBy(bu):
src/p/r/Products.RichImage-1.5/Products/RichImage/field.py Products.RichImage(Download)
from ZODB.POSException import ConflictError from Products.Archetypes.utils import shasattr from Products.Archetypes.Registry import registerField from Products.CMFCore import permissions
return '' image = self._wrapValue(instance, image, **kwargs) if shasattr(image, '__of__', acquire=True) and not kwargs.get('unwrapped', False): return image.__of__(instance) else:
src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/BaseObject.py Products.Archetypes(Download)
from Products.Archetypes.utils import mapply from Products.Archetypes.utils import fixSchema from Products.Archetypes.utils import shasattr from Products.Archetypes.Field import StringField from Products.Archetypes.Field import TextField
def title_or_id(self): """Returns the title if it is not blank and the id otherwise. """ if shasattr(self, 'Title'): if callable(self.Title):
with the uid catalog. """ if shasattr(self, 'getTypeInfo'): ti = self.getTypeInfo() if ti is not None:
return value.isBinary() mimetype = self.getContentType(key) if mimetype and shasattr(mimetype, 'binary'): return mimetype.binary elif mimetype and mimetype.find('text') >= 0:
field = self.getField(key) or getattr(self, key, None) if field and shasattr(field, 'getFilename'): return field.getFilename(self)
src/p/r/Products.Archetypes-HEAD/Products/Archetypes/BaseObject.py Products.Archetypes(Download)
from Products.Archetypes.utils import mapply from Products.Archetypes.utils import fixSchema from Products.Archetypes.utils import shasattr from Products.Archetypes.Field import StringField from Products.Archetypes.Field import TextField
def title_or_id(self): """Returns the title if it is not blank and the id otherwise. """ if shasattr(self, 'Title'): if callable(self.Title):
with the uid catalog. """ if shasattr(self, 'getTypeInfo'): ti = self.getTypeInfo() if ti is not None:
return value.isBinary() mimetype = self.getContentType(key) if mimetype and shasattr(mimetype, 'binary'): return mimetype.binary elif mimetype and mimetype.find('text') >= 0:
field = self.getField(key) or getattr(self, key, None) if field and shasattr(field, 'getFilename'): return field.getFilename(self)
src/p/r/Products.ATSchemaEditorNG-0.6/Products/ATSchemaEditorNG/ParentManagedSchema.py Products.ATSchemaEditorNG(Download)
from interfaces import IParentManagedSchema, ISchemaEditor from Products.CMFCore.utils import getToolByName from Products.Archetypes.utils import shasattr from Products.Archetypes.utils import capitalize from Products.Archetypes.utils import DisplayList
# ATT: mind the difference btn 'hasattr' and 'shasattr' (latter strips acq) if not hasattr(self, 'aq_parent') or self.id.find('atse-ptypedummy')>=0: if shasattr(self, 'schema'): return self._wrap_schema(self.schema) else:
self._v_schema = self._lookupChanges(schema_id) if not shasattr(self, '_md'): self.initializeArchetype()
if name != 'subject': accessor_name = getattr(field, 'accessor', None) if accessor_name and shasattr(self, accessor_name): pass # the accessor exists, we're cool else:
# getter with conformant naming scheme con_name = capitalize(field.getName()) dogenerate = not shasattr(self, 'get%s' % con_name) edit_accessor_name = getattr(field, 'edit_accessor', None)
src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/Schema/__init__.py Products.Archetypes(Download)
from Products.Archetypes.interfaces.schema import ISchema, ISchemata, \ IManagedSchema from Products.Archetypes.utils import OrderedDict, mapply, shasattr from Products.Archetypes.mimetype_utils import getDefaultContentType from Products.Archetypes.exceptions import SchemaException
# attribute missing: missing_attrs = [attr for attr in values.keys() \ if not shasattr(field, attr)] if missing_attrs: continue
kw = {'field': field.__name__, '_initializing_': True} if shasattr(field, 'default_content_type'): # specify a mimetype if the mutator takes a # mimetype argument
src/p/r/Products.PloneFormGen-1.7.14/Products/PloneFormGen/content/formMailerAdapter.py Products.PloneFormGen(Download)
from Products.Archetypes.public import * from Products.Archetypes.utils import OrderedDict from Products.Archetypes.utils import shasattr from Products.ATContentTypes.content.base import registerATCT
def setBody_pt(self, value, **kw): # """ set body template with BBB for accessors """ if shasattr(value, 'replace'): template = value
# get Reply-To reply_addr = None if shasattr(self, 'replyto_field'): reply_addr = request.form.get(self.replyto_field, None) # get subject header nosubject = '(no subject)' if shasattr(self, 'subjectOverride') and self.getRawSubjectOverride():
# Get From address if shasattr(self, 'senderOverride') and self.getRawSenderOverride(): from_addr = self.getSenderOverride().strip() else:
src/p/r/Products.Archetypes-HEAD/Products/Archetypes/Schema/__init__.py Products.Archetypes(Download)
from Products.Archetypes.interfaces.schema import ISchema, ISchemata, \ IManagedSchema from Products.Archetypes.utils import OrderedDict, mapply, shasattr from Products.Archetypes.mimetype_utils import getDefaultContentType from Products.Archetypes.exceptions import SchemaException
# attribute missing: missing_attrs = [attr for attr in values.keys() \ if not shasattr(field, attr)] if missing_attrs: continue
kw = {'field': field.__name__, '_initializing_': True} if shasattr(field, 'default_content_type'): # specify a mimetype if the mutator takes a # mimetype argument
src/p/r/Products.PloneFormGen-HEAD/Products/PloneFormGen/content/formMailerAdapter.py Products.PloneFormGen(Download)
from Products.Archetypes.public import * from Products.Archetypes.utils import OrderedDict from Products.Archetypes.utils import shasattr from Products.ATContentTypes.content.base import registerATCT
def setBody_pt(self, value, **kw): # """ set body template with BBB for accessors """ if shasattr(value, 'replace'): template = value
# get Reply-To reply_addr = None if shasattr(self, 'replyto_field'): reply_addr = request.form.get(self.replyto_field, None) # get subject header nosubject = '(no subject)' if shasattr(self, 'subjectOverride') and self.getRawSubjectOverride():
# Get From address if shasattr(self, 'senderOverride') and self.getRawSenderOverride(): from_addr = self.getSenderOverride().strip() else:
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next