Datasets:
Update to official format (placing artists directly after copyright before general tags)
Browse files- randumbizer.py +13 -4
randumbizer.py
CHANGED
|
@@ -11,15 +11,24 @@ def read_random_lines(artist_file="artist.txt", sheet_file="Sheet1.txt"):
|
|
| 11 |
while artist_lines:
|
| 12 |
sheet_line = random.choice(sheet_lines).strip()
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
|
|
|
| 16 |
selected_artist_lines = artist_lines[:num_artist_lines]
|
| 17 |
artist_lines = artist_lines[num_artist_lines:]
|
| 18 |
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
-
print(
|
| 22 |
-
pyperclip.copy(
|
| 23 |
print("\nContent copied to clipboard.")
|
| 24 |
|
| 25 |
input("\nPress Enter to get more lines...\n")
|
|
|
|
| 11 |
while artist_lines:
|
| 12 |
sheet_line = random.choice(sheet_lines).strip()
|
| 13 |
|
| 14 |
+
splits = sheet_line.split(", ")
|
| 15 |
+
if splits[0] in ["1girl", "1boy", "1other"]:
|
| 16 |
+
insertion_index = 3
|
| 17 |
+
else:
|
| 18 |
+
insertion_index = 2
|
| 19 |
|
| 20 |
+
num_artist_lines = random.randint(1, 4)
|
| 21 |
selected_artist_lines = artist_lines[:num_artist_lines]
|
| 22 |
artist_lines = artist_lines[num_artist_lines:]
|
| 23 |
|
| 24 |
+
new_line = (
|
| 25 |
+
", ".join(splits[:insertion_index]) + ", " +
|
| 26 |
+
", ".join(line.strip() for line in selected_artist_lines) +
|
| 27 |
+
", " + ", ".join(splits[insertion_index:])
|
| 28 |
+
)
|
| 29 |
|
| 30 |
+
print(new_line)
|
| 31 |
+
pyperclip.copy(new_line)
|
| 32 |
print("\nContent copied to clipboard.")
|
| 33 |
|
| 34 |
input("\nPress Enter to get more lines...\n")
|