mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 13:23:18 -07:00
Update vendored windows libs
This commit is contained in:
parent
f61c211655
commit
b1cefa94e5
226 changed files with 33472 additions and 11882 deletions
25
libs/win/jaraco/text/layouts.py
Normal file
25
libs/win/jaraco/text/layouts.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
qwerty = "-=qwertyuiop[]asdfghjkl;'zxcvbnm,./_+QWERTYUIOP{}ASDFGHJKL:\"ZXCVBNM<>?"
|
||||
dvorak = "[]',.pyfgcrl/=aoeuidhtns-;qjkxbmwvz{}\"<>PYFGCRL?+AOEUIDHTNS_:QJKXBMWVZ"
|
||||
|
||||
|
||||
to_dvorak = str.maketrans(qwerty, dvorak)
|
||||
to_qwerty = str.maketrans(dvorak, qwerty)
|
||||
|
||||
|
||||
def translate(input, translation):
|
||||
"""
|
||||
>>> translate('dvorak', to_dvorak)
|
||||
'ekrpat'
|
||||
>>> translate('qwerty', to_qwerty)
|
||||
'x,dokt'
|
||||
"""
|
||||
return input.translate(translation)
|
||||
|
||||
|
||||
def _translate_stream(stream, translation):
|
||||
"""
|
||||
>>> import io
|
||||
>>> _translate_stream(io.StringIO('foo'), to_dvorak)
|
||||
urr
|
||||
"""
|
||||
print(translate(stream.read(), translation))
|
Loading…
Add table
Add a link
Reference in a new issue