mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update RapydScript
This commit is contained in:
parent
cc0e4f9dc7
commit
1a28db1073
Binary file not shown.
20
resources/rapydscript/lib/pythonize.pyj
Normal file
20
resources/rapydscript/lib/pythonize.pyj
Normal file
@ -0,0 +1,20 @@
|
||||
# vim:fileencoding=utf-8
|
||||
# License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
# globals: _$rapyd$_str
|
||||
|
||||
def strings():
|
||||
string_funcs = set((
|
||||
'capitalize strip lstrip rstrip islower isupper isspace lower upper swapcase'
|
||||
' center count endswith startswith find rfind index rindex format join ljust rjust'
|
||||
' partition rpartition replace split rsplit splitlines zfill').split(' '))
|
||||
|
||||
if not arguments.length:
|
||||
exclude = {'split', 'replace'}
|
||||
elif arguments[0]:
|
||||
exclude = Array.prototype.slice.call(arguments)
|
||||
else:
|
||||
exclude = None
|
||||
if exclude:
|
||||
string_funcs = string_funcs.difference(set(exclude))
|
||||
for name in string_funcs:
|
||||
String.prototype[name] = _$rapyd$_str.prototype[name]
|
Loading…
x
Reference in New Issue
Block a user