Did I find the right examples for you? yes no

All Samples(17)  |  Call(10)  |  Derive(0)  |  Import(7)

        def opentext(path, mode='r'):
    if mode == 'r':
        newline = None
    else:
        newline = '\n'
    return open(path, mode,
                encoding='utf-8', errors='replace',
                newline=newline)
        


src/s/a/saku-HEAD/shingetsu/daemon.py   saku(Download)
from . import httpd
from . import crond
from .util import opentext
 
 
        elif self.logfile == '':
            self.logfile = newlog
            self.output = opentext(self.logfile, 'a')
        else:
            self.output.close()
            self.logfile = newlog
            self.output = opentext(self.logfile, 'a')

src/s/a/saku-HEAD/shingetsu/tiedobj.py   saku(Download)
 
from . import config
from .util import opentext
 
__all__ = ['tiedlist', 'tieddict']
        try:
            if (self.path is not None) and os.path.isfile(self.path):
                for line in opentext(self.path):
                    if self.elemclass is not None:
                        try:
            elif self.path in _cache:
                del _cache[self.path]
            f = opentext(self.path, 'w')
            for elem in self.data:
                if not isinstance(elem, str):
        try:
            if (self.path is not None) and os.path.isfile(self.path):
                for line in opentext(self.path):
                    try:
                        key, str_values = line.strip().split('<>', 1)
            elif self.path in _cache:
                del _cache[self.path]
            f = opentext(self.path, 'w')
            for key in self.data:
                line = ('%s<>%s\n' %

src/s/a/saku-HEAD/shingetsu/client_cgi.py   saku(Download)
from .tag import UserTagList
from .updatequeue import UpdateQueue
from .util import opentext
 
 
    def sync(self):
        try:
            f = opentext(self.statusfile, 'w')
            for k in ("ping", "init", "sync"):
                f.write(str(self[k]) + '\n')

src/s/a/saku-HEAD/shingetsu/gateway.py   saku(Download)
from .template import Template
from .updatequeue import UpdateQueue
from .util import opentext
 
 
    def __init__(self, file):
        dict.__init__(self)
        try:
            f = opentext(file)
            del_eos = re.compile(r"[\r\n]*")

src/s/a/saku-HEAD/shingetsu/server_cgi.py   saku(Download)
from .node import *
from .updatequeue import UpdateQueue
from .util import opentext
 
 
    def do_motd(self):
        self.header("text/plain")
        try:
            f = opentext(config.motd)
            for line in f:

src/s/a/saku-HEAD/shingetsu/conflist.py   saku(Download)
import os.path
 
from .util import opentext
 
__all__ = ['ConfList', 'RegExpList']
            self.mtime = mtime
            self.data = []
            f = opentext(self.path)
            for line in f:
                line = line.strip()

src/s/a/saku-HEAD/shingetsu/gateway_cgi.py   saku(Download)
from .tag import UserTagList
from .rss import RSS, make_rss1
from .util import opentext