summaryrefslogtreecommitdiff
path: root/tools/mpaste
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-10-13 16:33:13 +0200
committerinfirit <[email protected]>2014-10-13 16:33:13 +0200
commit3d32c0108124d82af989f73eb4d8a6ffe62f3393 (patch)
tree80fd413f8c6860479cd6bbf4fa8b849df12aaa55 /tools/mpaste
parenta267e864a373d7a3f251d63416e74c9e1d581a8b (diff)
downloadmate-desktop-3d32c0108124d82af989f73eb4d8a6ffe62f3393.tar.bz2
mate-desktop-3d32c0108124d82af989f73eb4d8a6ffe62f3393.tar.xz
mpaste: Truncate title to max 30 character
Diffstat (limited to 'tools/mpaste')
-rwxr-xr-xtools/mpaste3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/mpaste b/tools/mpaste
index 866826d..76548d3 100755
--- a/tools/mpaste
+++ b/tools/mpaste
@@ -36,6 +36,7 @@ def build_paste(args, data):
values = {}
for opt, val in args.__dict__.items():
if opt == 'infile': continue
+ if opt == 'title': values[opt] = val[:29]
if val: values[opt] = val
values['data'] = data
@@ -162,7 +163,7 @@ if __name__ == '__main__':
# If we read a file and no title given use the file name
if not args.title and args.infile.name != '<stdin>':
- paste['title'] = args.infile.name
+ paste['title'] = args.infile.name[:29]
# Post the data to the website
resp = session.post(api_url + 'create', data=paste)