CMS 3D CMS Logo

List of all members | Public Member Functions
BeautifulSoup.NavigableString Class Reference
Inheritance diagram for BeautifulSoup.NavigableString:
BeautifulSoup.PageElement BeautifulSoup.CData BeautifulSoup.Comment BeautifulSoup.Declaration BeautifulSoup.ProcessingInstruction

Public Member Functions

def __getattr__ (self, attr)
 
def __getnewargs__ (self)
 
def __new__ (cls, value)
 
def __str__ (self, encoding=DEFAULT_OUTPUT_ENCODING)
 
def __unicode__ (self)
 
- Public Member Functions inherited from BeautifulSoup.PageElement
def append (self, tag)
 
def extract (self)
 
def findAllNext (self, name=None, attrs={}, text=None, limit=None, kwargs)
 
def findAllPrevious (self, name=None, attrs={}, text=None, limit=None, kwargs)
 
def findNext (self, name=None, attrs={}, text=None, kwargs)
 
def findNextSibling (self, name=None, attrs={}, text=None, kwargs)
 
def findNextSiblings (self, name=None, attrs={}, text=None, limit=None, kwargs)
 
def findParent (self, name=None, attrs={}, kwargs)
 
def findParents (self, name=None, attrs={}, limit=None, kwargs)
 
def findPrevious (self, name=None, attrs={}, text=None, kwargs)
 
def findPreviousSibling (self, name=None, attrs={}, text=None, kwargs)
 
def findPreviousSiblings (self, name=None, attrs={}, text=None, limit=None, kwargs)
 
def insert (self, position, newChild)
 
def nextGenerator (self)
 
def nextSiblingGenerator (self)
 
def parentGenerator (self)
 
def previousGenerator (self)
 
def previousSiblingGenerator (self)
 
def replaceWith (self, replaceWith)
 
def replaceWithChildren (self)
 
def setup (self, parent=None, previous=None)
 
def substituteEncoding (self, str, encoding=None)
 
def toEncoding (self, s, encoding=None)
 

Additional Inherited Members

- Public Attributes inherited from BeautifulSoup.PageElement
 next
 
 nextSibling
 
 parent
 
 previous
 
 previousSibling
 

Detailed Description

Definition at line 450 of file BeautifulSoup.py.

Member Function Documentation

def BeautifulSoup.NavigableString.__getattr__ (   self,
  attr 
)
text.string gives you text. This is for backwards
compatibility for Navigable*String, but for CData* it lets you
get the string without the CData wrapper.

Definition at line 467 of file BeautifulSoup.py.

Referenced by VarParsing.VarParsing.setType().

467  def __getattr__(self, attr):
468  """text.string gives you text. This is for backwards
469  compatibility for Navigable*String, but for CData* it lets you
470  get the string without the CData wrapper."""
471  if attr == 'string':
472  return self
473  else:
474  raise AttributeError("'%s' object has no attribute '%s'" % (self.__class__.__name__, attr))
475 
def BeautifulSoup.NavigableString.__getnewargs__ (   self)

Definition at line 464 of file BeautifulSoup.py.

464  def __getnewargs__(self):
465  return (NavigableString.__str__(self),)
466 
def BeautifulSoup.NavigableString.__new__ (   cls,
  value 
)
Create a new NavigableString.

When unpickling a NavigableString, this method is called with
the string in DEFAULT_OUTPUT_ENCODING. That encoding needs to be
passed in to the superclass's __new__ or the superclass won't know
how to handle non-ASCII characters.

Definition at line 452 of file BeautifulSoup.py.

Referenced by SequenceTypes._ModuleSequenceType.copyAndExclude().

452  def __new__(cls, value):
453  """Create a new NavigableString.
454 
455  When unpickling a NavigableString, this method is called with
456  the string in DEFAULT_OUTPUT_ENCODING. That encoding needs to be
457  passed in to the superclass's __new__ or the superclass won't know
458  how to handle non-ASCII characters.
459  """
460  if isinstance(value, unicode):
461  return unicode.__new__(cls, value)
462  return unicode.__new__(cls, value, DEFAULT_OUTPUT_ENCODING)
463 
def BeautifulSoup.NavigableString.__str__ (   self,
  encoding = DEFAULT_OUTPUT_ENCODING 
)

Definition at line 479 of file BeautifulSoup.py.

References BeautifulSoup.PageElement._sub_entity().

Referenced by edmStreamStallGrapher.Point.__repr__(), BeautifulSoup.Tag.__repr__(), BeautifulSoup.Tag.__unicode__(), and BeautifulSoup.Tag.prettify().

479  def __str__(self, encoding=DEFAULT_OUTPUT_ENCODING):
480  # Substitute outgoing XML entities.
481  data = self.BARE_AMPERSAND_OR_BRACKET.sub(self._sub_entity, self)
482  if encoding:
483  return data.encode(encoding)
484  else:
485  return data
486 
def __str__(self, encoding=DEFAULT_OUTPUT_ENCODING)
def BeautifulSoup.NavigableString.__unicode__ (   self)

Definition at line 476 of file BeautifulSoup.py.

References edm.decode(), and str.

476  def __unicode__(self):
477  return str(self).decode(DEFAULT_OUTPUT_ENCODING)
478 
bool decode(bool &, std::string const &)
Definition: types.cc:72
#define str(s)