Commit dd1ea06b authored by Elizabeth Myers's avatar Elizabeth Myers 💬

Merge branch 'master' of http://code.foxkit.us/Elizafox/83bot

parents 77750e3d 04328465
......@@ -71,7 +71,7 @@ class Generator:
if total_len > 13:
# Even with continuations we can't exceed this, but let's
# give a random chance to shorten, or try again.
if random.randint(0, 5) == 0:
if random.randint(0, 14) == 0:
filename += word
filename = filename[:6]
filename += "~1"
......@@ -96,22 +96,22 @@ class Generator:
filename += word
# Special cases
if total_len == 6 and random.randint(0, 9) != 0:
# 1 in 10 chance of a ~1 substitution
if total_len == 6 and random.randint(0, 14) != 0:
# 1 in 15 chance of a ~1 substitution
filename += "~1"
elif total_len == 7 and random.randint(0, 19) != 0:
# 1 in 20 chance of continuing, otherwise consider adding ~1 or
# a character, then the extension
if random.randint(0, 4) == 0:
# 1 in 5 chance of adding ~1
if random.randint(0, 14) == 0:
# 1 in 15 chance of adding ~1
filename = filename[:6] + "~1"
else:
filename += random.choice(self.validlast)
filename += random.choice(self.extlist).upper()
elif total_len == 8:
# 1 in 10 chance we change it to ~1
if random.randint(0, 9) == 0:
# 1 in 15 chance we change it to ~1
if random.randint(0, 14) == 0:
filename = filename[:6] + "~1"
# Add extension and call it a day
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment