Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(3)  |  Derive(0)  |  Import(3)
Return an object suitable for use in a for loop that will iterate the
lines of the file 'f'.  Uses the xreadlines module if necessary,
or file.__iter__ if possible.

        def iterFileLines(f):
    """Return an object suitable for use in a for loop that will iterate the
       lines of the file 'f'.  Uses the xreadlines module if necessary,
       or file.__iter__ if possible.
    """
    if xreadlines is not None:
        return xreadlines.xreadlines(f)
    elif iter is not None:
        return iter(f)
    else:
        return f.readlines()
        


src/m/i/mixminion-HEAD/lib/mixminion/directory/ServerList.py   mixminion(Download)
from mixminion.Crypto import pk_decode_public_key, pk_encode_public_key, \
     pk_same_public_key
from mixminion.Common import IntervalSet, LOG, MixError, MixFatalError, \
     UIError, createPrivateDir, formatBase64, formatDate, formatFnameTime, \
     formatTime, iterFileLines, Lockfile, openUnique, previousMidnight, readFile,\
    def addServersFromRawDirectoryFile(self, file):
        curLines = []
        for line in iterFileLines(file):
            if line == '[Server]\n' and curLines:
                self._addOneFromRawLines(curLines)

src/m/i/mixminion-HEAD/lib/mixminion/directory/DirMain.py   mixminion(Download)
import sys
import time
from mixminion.Common import createPrivateDir, formatTime, iterFileLines, LOG, \
     UIError
from mixminion.Config import ConfigError
            continue
        f = open(fn, 'r')
        for ln in iterFileLines(f):
            ln = ln.strip()
            if ln and ln[0] != '#':

src/m/i/mixminion-HEAD/lib/mixminion/directory/Directory.py   mixminion(Download)
import mixminion.Crypto
 
from mixminion.Common import LOG, MixError, MixFatalError, UIError, \
     formatBase64, iterFileLines, writePickled, readPickled, formatTime
 
            lineno = 0
            fname = self._fname_base
            for line in iterFileLines(f):
                lineno += 1
                line = line.strip()