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
 
- Static Public Attributes inherited from BeautifulSoup.PageElement
 BARE_AMPERSAND_OR_BRACKET
 
 fetchNextSiblings
 
 fetchParents
 
 fetchPrevious
 
 fetchPreviousSiblings
 
 XML_ENTITIES_TO_SPECIAL_CHARS
 
 XML_SPECIAL_CHARS_TO_ENTITIES
 

Detailed Description

Definition at line 449 of file BeautifulSoup.py.

Member Function Documentation

◆ __getattr__()

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 466 of file BeautifulSoup.py.

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

References __class__< T >.__class__().

Referenced by VarParsing.VarParsing.setType().

◆ __getnewargs__()

def BeautifulSoup.NavigableString.__getnewargs__ (   self)

Definition at line 463 of file BeautifulSoup.py.

463  def __getnewargs__(self):
464  return (NavigableString.__str__(self),)
465 

◆ __new__()

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 451 of file BeautifulSoup.py.

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

Referenced by SequenceTypes._ModuleSequenceType.copyAndExclude().

◆ __str__()

def BeautifulSoup.NavigableString.__str__ (   self,
  encoding = DEFAULT_OUTPUT_ENCODING 
)

Reimplemented in BeautifulSoup.Declaration, BeautifulSoup.Comment, BeautifulSoup.ProcessingInstruction, and BeautifulSoup.CData.

Definition at line 478 of file BeautifulSoup.py.

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

References BeautifulSoup.PageElement._sub_entity(), and BeautifulSoup.PageElement.BARE_AMPERSAND_OR_BRACKET.

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

◆ __unicode__()

def BeautifulSoup.NavigableString.__unicode__ (   self)

Definition at line 475 of file BeautifulSoup.py.

475  def __unicode__(self):
476  return str(self).decode(DEFAULT_OUTPUT_ENCODING)
477 

References edm.decode(), and str.

str
#define str(s)
Definition: TestProcessor.cc:51
TriggerAnalyzer.__str__
def __str__(self)
Definition: TriggerAnalyzer.py:103
edm::decode
bool decode(bool &, std::string const &)
Definition: types.cc:72