summaryrefslogtreecommitdiffstats
path: root/gallery_dl/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/util.py')
-rw-r--r--gallery_dl/util.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/gallery_dl/util.py b/gallery_dl/util.py
index 2466adf..78663a0 100644
--- a/gallery_dl/util.py
+++ b/gallery_dl/util.py
@@ -81,6 +81,15 @@ def raises(cls):
return wrap
+def identity(x):
+ """Returns its argument"""
+ return x
+
+
+def noop():
+ """Does nothing"""
+
+
def generate_token(size=16):
"""Generate a random token with hexadecimal digits"""
data = random.getrandbits(size * 8).to_bytes(size, "big")
@@ -321,7 +330,7 @@ CODES = {
"hu": "Hungarian",
"id": "Indonesian",
"it": "Italian",
- "jp": "Japanese",
+ "ja": "Japanese",
"ko": "Korean",
"ms": "Malay",
"nl": "Dutch",
@@ -804,7 +813,7 @@ class PathFormat():
@staticmethod
def _build_cleanfunc(chars, repl):
if not chars:
- return lambda x: x
+ return identity
elif isinstance(chars, dict):
def func(x, table=str.maketrans(chars)):
return x.translate(table)