From 04cdcb0feb369ac4c60e10ccdc139c57e8b52e62 Mon Sep 17 00:00:00 2001 From: Zearin Date: Fri, 7 Oct 2011 10:34:23 -0400 Subject: Removed leftovers from installing with pip. Oops! I noticed there was a bunch of extra crap left over from when I installed this module onto my own system. I thought it wouldn't have modified itself at the time (just the Python module library on my system), but I was wrong. Begone, useless cruft! --- doxygen/html/classcmd2_1_1History.html | 519 --------------------------------- 1 file changed, 519 deletions(-) delete mode 100644 doxygen/html/classcmd2_1_1History.html (limited to 'doxygen/html/classcmd2_1_1History.html') diff --git a/doxygen/html/classcmd2_1_1History.html b/doxygen/html/classcmd2_1_1History.html deleted file mode 100644 index b255a90..0000000 --- a/doxygen/html/classcmd2_1_1History.html +++ /dev/null @@ -1,519 +0,0 @@ - - - - -Cmd2: cmd2::History Class Reference - - - - - - - - - - - - - - -
- - -
- - - - - - - - - - - -
-
Cmd2 - -
- -
-
- - - - - -
-
- -
-
-
- -
-
- -
-
cmd2::History Class Reference
-
-
- -

List of all members.

- - - - - - - - - - - - -

-Public Member Functions

def append
def extend
def get
def search
def span
def to_index
def zero_based_index

-Static Public Attributes

tuple rangePattern = re.compile(r'^\s*(?P<start>[\d]+)?\s*\-\s*(?P<end>[\d]+)?\s*$')
tuple spanpattern = re.compile(r'^\s*(?P<start>\-?\d+)?\s*(?P<separator>:|(\.{2,}))?\s*(?P<end>\-?\d+)?\s*$')
-

Detailed Description

-
A list of HistoryItems that knows how to respond to user requests.
->>> h = History([HistoryItem('first'), HistoryItem('second'), HistoryItem('third'), HistoryItem('fourth')])
->>> h.span('-2..')
-['third', 'fourth']
->>> h.span('2..3')
-['second', 'third']
->>> h.span('3')
-['third']    
->>> h.span(':')
-['first', 'second', 'third', 'fourth']
->>> h.span('2..')
-['second', 'third', 'fourth']
->>> h.span('-1')
-['fourth']    
->>> h.span('-2..-3')
-['third', 'second']      
->>> h.search('o')
-['second', 'fourth']
->>> h.search('/IR/')
-['first', 'third']
-
-

Definition at line 1304 of file cmd2.py.

-

Member Function Documentation

- -
-
- - - - - - - - - - - - - - - - - - -
def cmd2::History::append ( self,
 new 
)
-
-
- -

Definition at line 1368 of file cmd2.py.

- -

Referenced by extend().

-
01368 
-01369     def append(self, new):
-01370         new = HistoryItem(new)
-01371         list.append(self, new)
-        new.idx = len(self)
-
-
-
- -
-
- - - - - - - - - - - - - - - - - - -
def cmd2::History::extend ( self,
 new 
)
-
-
- -

Definition at line 1372 of file cmd2.py.

- -

References cmd2::StubbornDict::append, and append().

-
01372 
-01373     def extend(self, new):
-01374         for n in new:
-01375             self.append(n)
-        
-
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
def cmd2::History::get ( self,
 getme = None,
 fromEnd = False 
)
-
-
- -

Definition at line 1376 of file cmd2.py.

-
01376 
-01377     def get(self, getme=None, fromEnd=False):
-01378         if not getme:
-01379             return self
-01380         try:
-01381             getme = int(getme)
-01382             if getme < 0:
-01383                 return self[:(-1 * getme)]
-01384             else:
-01385                 return [self[getme-1]]
-01386         except IndexError:
-01387             return []
-01388         except ValueError:
-01389             rangeResult = self.rangePattern.search(getme)
-01390             if rangeResult:
-01391                 start = rangeResult.group('start') or None
-01392                 end = rangeResult.group('start') or None
-01393                 if start:
-01394                     start = int(start) - 1
-01395                 if end:
-01396                     end = int(end)
-01397                 return self[start:end]
-01398                 
-01399             getme = getme.strip()
-01400 
-01401             if getme.startswith(r'/') and getme.endswith(r'/'):
-01402                 finder = re.compile(getme[1:-1], re.DOTALL | re.MULTILINE | re.IGNORECASE)
-01403                 def isin(hi):
-01404                     return finder.search(hi)
-01405             else:
-01406                 def isin(hi):
-01407                     return (getme.lower() in hi.lowercase)
-01408             return [itm for itm in self if isin(itm)]
-
-
-
-
- -
-
- - - - - - - - - - - - - - - - - - -
def cmd2::History::search ( self,
 target 
)
-
-
- -

Definition at line 1337 of file cmd2.py.

-
01337 
-01338     def search(self, target):
-01339         target = target.strip()
-01340         if target[0] == target[-1] == '/' and len(target) > 1:
-01341             target = target[1:-1]
-01342         else:
-01343             target = re.escape(target)
-01344         pattern = re.compile(target, re.IGNORECASE)
-        return [s for s in self if pattern.search(s)]
-
-
-
- -
-
- - - - - - - - - - - - - - - - - - -
def cmd2::History::span ( self,
 raw 
)
-
-
- -

Definition at line 1346 of file cmd2.py.

- -

References to_index().

-
01346 
-01347     def span(self, raw):
-01348         if raw.lower() in ('*', '-', 'all'):
-01349             raw = ':'
-01350         results = self.spanpattern.search(raw)
-01351         if not results:
-01352             raise IndexError
-01353         if not results.group('separator'):
-01354             return [self[self.to_index(results.group('start'))]]
-01355         start = self.to_index(results.group('start'))
-01356         end = self.to_index(results.group('end'))
-01357         reverse = False
-01358         if end is not None:
-01359             if end < start:
-01360                 (start, end) = (end, start)
-01361                 reverse = True
-01362             end += 1
-01363         result = self[start:end]
-01364         if reverse:
-01365             result.reverse()
-01366         return result
-                
-
-
-
- -
-
- - - - - - - - - - - - - - - - - - -
def cmd2::History::to_index ( self,
 raw 
)
-
-
- -

Definition at line 1331 of file cmd2.py.

- -

References zero_based_index().

- -

Referenced by span().

-
01331 
-01332     def to_index(self, raw):
-01333         if raw:
-01334             result = self.zero_based_index(int(raw))
-01335         else:
-01336             result = None
-        return result
-
-
-
- -
-
- - - - - - - - - - - - - - - - - - -
def cmd2::History::zero_based_index ( self,
 onebased 
)
-
-
- -

Definition at line 1326 of file cmd2.py.

- -

Referenced by to_index().

-
01326 
-01327     def zero_based_index(self, onebased):
-01328         result = onebased
-01329         if result > 0:
-01330             result -= 1
-        return result
-
-
-
-

Member Data Documentation

- -
-
- - - - -
tuple cmd2::History::rangePattern = re.compile(r'^\s*(?P<start>[\d]+)?\s*\-\s*(?P<end>[\d]+)?\s*$') [static]
-
-
- -

Definition at line 1367 of file cmd2.py.

- -
-
- -
-
- - - - -
tuple cmd2::History::spanpattern = re.compile(r'^\s*(?P<start>\-?\d+)?\s*(?P<separator>:|(\.{2,}))?\s*(?P<end>\-?\d+)?\s*$') [static]
-
-
- -

Definition at line 1345 of file cmd2.py.

- -
-
-
The documentation for this class was generated from the following file:
    -
  • /Users/amrogers/Developer/Projects/cmd2/cmd2.py
  • -
-
-
- - - - - -- cgit v1.2.1