Skip to content
This repository was archived by the owner on Nov 24, 2020. It is now read-only.

Commit c1328da

Browse files
committed
Add pastebins to a dict, default to nnmm
1 parent c1b08a9 commit c1328da

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

utils/pastebins.py

+7-9
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
import config
44

55
def paste(data):
6-
if config.PASTEBIN == 'sprunge':
7-
return sprunge(data)
8-
if config.PASTEBIN == 'nnmm':
9-
return nnmm(data)
10-
if config.PASTEBIN == 'sicpme':
11-
return sicpme(data)
12-
if config.PASTEBIN == 'ix':
13-
return ix(data)
14-
raise NotImplementedError
6+
pastebins = {
7+
'sprunge': sprunge,
8+
'nnmm': nnmm,
9+
'sicpme': sicpme,
10+
'ix': ix,
11+
}
12+
return pastebins.get(getattr(config, 'PASTEBIN', ''), nnmm)(data)
1513

1614
def sprunge(data):
1715
sprunge_data = {"sprunge": data}

0 commit comments

Comments
 (0)