https://bugzilla.wikimedia.org/show_bug.cgi?id=55195

--- Comment #2 from Kunal Mehta (Legoktm) <[email protected]> ---
an idea for getFilename \(could anybody test it whether it works\)

if not title:
\#find the max length for a mw title
maxBytes = 240 - len\(project.encode\('utf-8'\)\) \
\- len\(username.encode\('utf-8'\)\)
description = photoInfo.find\('photo'\).find\('description'\).text
if description:
descBytes = len\(description.encode\('utf-8'\)\)
if descBytes &gt; maxBytes:
\# maybe we cut more than needed, anyway we do it
items = max\(0, len\(description\) - maxBytes + descBytes\)
description = description\[:items\]
title = cleanUpTitle\(description\)
else:
title = u''
\# Should probably have the id of the photo as last resort.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to