Standardized capitalization of Windows and POSIX
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Kevin Yap · committed by Armin Ronacher · parent 67523af · Browse files · 6 files·+10 added−10 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
6 files+10 added−10 removed
- other:+10 added−10 removed
Provenance
- Commit
e4dca8a- Tree
d309ee6- Author
Kevin Yap <me@kevinyap.ca>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
67523af
6 files changed+10 added−10 removed
modified:click/termui.py+4 added-4 removed
56 unmodified lines57 def prompt_func(text):58 f = hide_input and hidden_prompt_func or visible_prompt_func59 try:60 # Write the prompt separately so that we get nice61- # coloring through colorama on windows61+ # coloring through colorama on Windows62 echo(text, nl=False)63 return f('')64 except (KeyboardInterrupt, EOFError):65 raise Abort()47 unmodified lines113 default and 'Y/n' or 'y/N')114 while 1:115 try:116 # Write the prompt separately so that we get nice117- # coloring through colorama on windows117+ # coloring through colorama on Windows118 echo(prompt, nl=False)119 value = visible_prompt_func('').lower().strip()120 except (KeyboardInterrupt, EOFError):121 raise Abort()144 unmodified lines266 .. versionadded:: 2.0267 """268 if not isatty(sys.stdout):269 return270- # If we're on windows and we don't have colorama available, then we270+ # If we're on Windows and we don't have colorama available, then we271 # clear the screen by shelling out. Otherwise we can use an escape272 # sequence.273 if sys.platform.startswith('win') and colorama is None:274 os.system('cls')110 unmodified lines385 386 If the editor cannot be opened a :exc:`UsageError` is raised.387 388 Note for Windows: to simplify cross platform usage the newlines are389- automatically converted from posix to windows and reverse. As such the389+ automatically converted from POSIX to Windows and reverse. As such the390 message here will have ``\n`` as newline markers.391 392 :param text: the text to edit.393 :param editor: optionally the editor to use. Defaults to automatic94 unmodified linesmodified:click/types.py+1 added-1 removed
27 unmodified lines28 #: string environment variable, this is what splits it up. `None`29 #: means any whitespace. For all parameters the general rule is that30 #: whitespace splits them up. The exception are paths and files which31 #: are split by ``os.path.pathsep`` by default (":" on unix and ";" on32- #: windows).32+ #: Windows).33 envvar_list_splitter = None34 35 def __call__(self, value, param=None, ctx=None):36 if value is not None:395 unmodified linesmodified:click/utils.py+2 added-2 removed
318 unmodified lines319 the following folders could be returned:320 321 Mac OS X:322 ``~/Library/Application Support/Foo Bar``323- Mac OS X (posix):323+ Mac OS X (POSIX):324 ``~/.foo-bar``325 Unix:326 ``~/.config/foo-bar``327- Unix (posix):327+ Unix (POSIX):328 ``~/.foo-bar``329 Win XP (roaming):330 ``C:\Documents and Settings\<user>\Local Settings\Application Data\Foo Bar``331 Win XP (not roaming):31 unmodified linesmodified:examples/colors/setup.py+1 added-1 removed
5 unmodified lines6 py_modules=['colors'],7 include_package_data=True,8 install_requires=[9 'Click',10- # Colorama is only required for windows.10+ # Colorama is only required for Windows.11 'colorama',12 ],13 entry_points='''14 [console_scripts]3 unmodified linesmodified:examples/termui/setup.py+1 added-1 removed
5 unmodified lines6 py_modules=['termui'],7 include_package_data=True,8 install_requires=[9 'Click',10- # Colorama is only required for windows.10+ # Colorama is only required for Windows.11 'colorama',12 ],13 entry_points='''14 [console_scripts]3 unmodified linesmodified:CHANGES+1 added-1 removed
6 unmodified lines7 -----------8 9 (codename and release date to be decided)10 11-- added support for opening stdin/stdout on windows in11+- added support for opening stdin/stdout on Windows in12 binary mode correctly.13 - added support for atomic writes to files by going through14 a temporary file.15 - introduced :exc:`BadParameter` which can be used to easily perform41 unmodified lines