Jump to content

Talk:May Week

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Trinity May Ball

[edit]

Isn't Trinity May Ball traditionally on a Monday? cmɢʟee୯ ͡° ̮د ͡° ੭ 11:03, 13 June 2013 (UTC)[reply]

Trinity May Ball date is indeed wrong, could someone who knows how to work with wiki tables change this? 131.111.233.196 (talk) 20:41, 13 June 2013 (UTC)[reply]
Changed it. — Preceding unsigned comment added by 131.111.233.196 (talk) 20:48, 13 June 2013 (UTC)[reply]

Script used

[edit]

This revision was created using this script:

import itertools
from pprint import pprint
from collections import namedtuple

Day = namedtuple('Day', 'balls june_events garden_parties other')

def process_table(t):
	print('=' * 80)
	print()

	t = iter(t)

	next(t)

	yield '{| class="wikitable" style="width: 100%; table-layout: fixed"\n'
	for line in t:
		if line.startswith('! '):
			headings = [heading.strip() for heading in line[2:].split('||')]
			break

	rows = [
		[event.strip() for event in line[2:].split('||')]
		for line in t
		if not line.startswith('|-')
	]

	pprint(rows)

	days = itertools.zip_longest(*rows)
	days = [[event for event in col if event] for col in days]

	grouped_days = []
	for day in days:
		day = set(day)

		balls = {e for e in day if 'ball' in e.lower()}
		day -= balls

		june_events = {e for e in day if 'june' in e.lower()}
		day -= june_events

		garden_parties = {e for e in day if 'garden' in e.lower()}
		day -= garden_parties

		other = day

		grouped_days.append(Day(balls, june_events, garden_parties, other))

	pprint(grouped_days)

	yield '! !! May balls !! June events !! Garden parties !! Other events\n'

	for h, d in zip(headings, grouped_days):
		yield '|-\n'
		yield '\n\n'
		yield '! scope="row" | ' + h + '\n'
		yield '| <!-- balls -->\n'
		yield '\n'.join(x + '\n' for x in sorted(d.balls))
		yield '| <!-- june events -->\n'
		yield '\n'.join(x + '\n' for x in sorted(d.june_events))
		yield '| <!-- garden parties -->\n'
		yield '\n'.join(x + '\n' for x in sorted(d.garden_parties))
		yield '| <!-- other events -->\n'
		yield '\n'.join(x + '\n' for x in sorted(d.other))

	yield '|}'

	# return''.join(reversed(t))

with open('mayweek.txt') as f, open('mayweek.new.txt', 'w') as out:
	table = []
	for line in f:
		if line.startswith('{|') or table:
			table.append(line)

		if line.startswith('|}'):
			line = ''.join(process_table(table))
			table = []

		if not table:
			out.write(line)

Eric Wieser (talk) 16:32, 24 March 2014 (UTC)[reply]

[edit]

Hello fellow Wikipedians,

I have just modified 12 external links on May Week. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:

When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.

This message was posted before February 2018. After February 2018, "External links modified" talk page sections are no longer generated or monitored by InternetArchiveBot. No special action is required regarding these talk page notices, other than regular verification using the archive tool instructions below. Editors have permission to delete these "External links modified" talk page sections if they want to de-clutter talk pages, but see the RfC before doing mass systematic removals. This message is updated dynamically through the template {{source check}} (last update: 5 June 2024).

  • If you have discovered URLs which were erroneously considered dead by the bot, you can report them with this tool.
  • If you found an error with any archives or the URLs themselves, you can fix them with this tool.

Cheers.—InternetArchiveBot (Report bug) 02:33, 23 January 2018 (UTC)[reply]