From 3d32c0108124d82af989f73eb4d8a6ffe62f3393 Mon Sep 17 00:00:00 2001 From: infirit Date: Mon, 13 Oct 2014 16:33:13 +0200 Subject: mpaste: Truncate title to max 30 character --- tools/mpaste | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools') 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 != '': - 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) -- cgit v1.2.1