Mercurial > hgrepos > Python > libs > ConfigMix
comparison configmix/__init__.py @ 206:5064e3a2e54a
Doc: "configmix.try_determine_filemode()" got additional documentation
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sun, 05 May 2019 16:53:13 +0200 |
| parents | 7865f28038a4 |
| children | b3b5ed34d180 |
comparison
equal
deleted
inserted
replaced
| 205:344da17f01e3 | 206:5064e3a2e54a |
|---|---|
| 135 :param str filename: | 135 :param str filename: |
| 136 :return: the found mode string or `None` | 136 :return: the found mode string or `None` |
| 137 :rtype: str or None | 137 :rtype: str or None |
| 138 | 138 |
| 139 Only the first two lines are searched for. | 139 Only the first two lines are searched for. |
| 140 | |
| 141 Conveniently to be used in calls to :func:`~.set_assoc` to determine | |
| 142 the file-mode by content instead of filename extension. | |
| 140 | 143 |
| 141 """ | 144 """ |
| 142 with io.open(filename, encoding="ascii", errors="replace") as f: | 145 with io.open(filename, encoding="ascii", errors="replace") as f: |
| 143 idx = 0 | 146 idx = 0 |
| 144 for l in f: | 147 for l in f: |
