2012-12-19 10:30:49 +00:00
|
|
|
from flask import g, redirect, url_for
|
|
|
|
|
|
|
|
|
|
|
|
##############
|
|
|
|
# Legacy paths
|
|
|
|
|
2012-12-19 10:55:11 +00:00
|
|
|
LEGACY_FUNCTIONS_MAP={
|
2013-01-04 00:29:55 +00:00
|
|
|
'announcements': 'blog_index',
|
2013-01-04 00:55:25 +00:00
|
|
|
'download': 'downloads_list',
|
|
|
|
'statusnotes': 'blog_index',
|
2012-12-19 10:30:49 +00:00
|
|
|
}
|
|
|
|
|
2012-12-19 10:55:11 +00:00
|
|
|
LEGACY_PAGES_MAP={
|
2013-01-04 00:29:55 +00:00
|
|
|
'applications': 'volunteer/develop/applications',
|
2013-01-04 04:05:15 +00:00
|
|
|
'benchmarks': 'misc/benchmarks',
|
2013-01-04 00:29:55 +00:00
|
|
|
'bittorrent': 'docs/applications/bittorrent',
|
|
|
|
'blockfile': 'docs/spec/blockfile',
|
|
|
|
'bob': 'docs/api/bob',
|
|
|
|
'bounties': 'volunteer/bounties',
|
2013-01-04 01:12:49 +00:00
|
|
|
'bounty_arabic': 'volunteer/bounties/arabic',
|
|
|
|
'bounty_btcclient': 'volunteer/bounties/btcclient',
|
|
|
|
'bounty_datastore': 'volunteer/bounties/datastore',
|
|
|
|
'bounty_debpack': 'volunteer/bounties/debpack',
|
|
|
|
'bounty_i2phex': 'volunteer/bounties/i2phex',
|
|
|
|
'bounty_ipv6': 'volunteer/bounties/ipv6',
|
|
|
|
'bounty_rutrans': 'volunteer/bounties/rutrans',
|
|
|
|
'bounty_silc': 'volunteer/bounties/silc',
|
|
|
|
'bounty_syndie2012': 'volunteer/bounties/syndie2012',
|
|
|
|
'bounty_unittests': 'volunteer/bounties/unittests',
|
|
|
|
'bounty_vuzeplugin': 'volunteer/bounties/vuzeplugin',
|
|
|
|
'clt': 'misc/clt',
|
2013-01-04 00:29:55 +00:00
|
|
|
'common_structures_spec': 'docs/spec/common_structures',
|
|
|
|
'configuration': 'docs/spec/configuration',
|
2013-01-04 01:12:49 +00:00
|
|
|
'contact': 'about/contact',
|
|
|
|
'cvs': 'misc/cvs',
|
2013-01-04 00:29:55 +00:00
|
|
|
'datagrams': 'docs/spec/datagrams',
|
|
|
|
'dev-guidelines': 'volunteer/guides/devguidelines',
|
2013-01-04 01:12:49 +00:00
|
|
|
'developerskeys': 'volunteer/develop/developerskeys',
|
2013-01-04 00:29:55 +00:00
|
|
|
'donate': 'volunteer/donate',
|
|
|
|
'faq': 'support/faq',
|
|
|
|
'getinvolved': 'volunteer',
|
2013-01-04 01:12:49 +00:00
|
|
|
'glossary': 'support/glossary',
|
2013-01-04 00:29:55 +00:00
|
|
|
'halloffame': 'about/halloffame',
|
|
|
|
'how': 'docs',
|
|
|
|
'how_cryptography': 'docs/how/cryptography',
|
|
|
|
'how_elgamalaes': 'docs/how/elgamalaes',
|
2013-01-04 01:12:49 +00:00
|
|
|
'how_garlicrouting': 'docs/how/garlicrouting',
|
2013-01-04 00:29:55 +00:00
|
|
|
'how_intro': 'docs/how/intro',
|
|
|
|
'how_networkcomparisons': 'about/comparison',
|
|
|
|
'how_networkdatabase': 'docs/how/networkdatabase',
|
|
|
|
'how_peerselection': 'docs/how/peerselection',
|
|
|
|
'how_threatmodel': 'docs/how/threatmodel',
|
|
|
|
'how_tunnelrouting': 'docs/how/tunnelrouting',
|
2013-01-04 01:12:49 +00:00
|
|
|
'htproxyports': 'support/htproxyports',
|
2013-01-04 00:29:55 +00:00
|
|
|
'i2cp': 'docs/protocol/i2cp',
|
|
|
|
'i2cp_spec': 'docs/spec/i2cp',
|
|
|
|
'i2np': 'docs/protocol/i2np',
|
|
|
|
'i2np_spec': 'docs/spec/i2np',
|
|
|
|
'i2pcontrol': 'docs/api/i2pcontrol',
|
|
|
|
'i2ptunnel': 'docs/api/i2ptunnel',
|
2013-01-04 01:12:49 +00:00
|
|
|
'i2ptunnel_migration': 'misc/i2ptunnel_migration',
|
|
|
|
'i2ptunnel_services': 'misc/i2ptunnel_services',
|
|
|
|
'impressum': 'impressum',
|
2013-01-04 00:29:55 +00:00
|
|
|
'intro': 'about/intro',
|
2013-01-04 01:12:49 +00:00
|
|
|
'invisiblenet': 'misc/invisiblenet',
|
2013-01-04 00:29:55 +00:00
|
|
|
'jbigi': 'misc/jbigi',
|
2013-01-04 01:12:49 +00:00
|
|
|
'jrandom-awol': 'misc/jrandom-awol',
|
|
|
|
'license-agreements': 'volunteer/develop/license-agreements',
|
2013-01-04 00:29:55 +00:00
|
|
|
'licenses': 'volunteer/develop/licenses',
|
2013-01-04 01:12:49 +00:00
|
|
|
'links': 'links',
|
|
|
|
'manualwrapper': 'misc/manualwrapper',
|
|
|
|
'ministreaming': 'docs/api/ministreaming',
|
|
|
|
'minwww': 'misc/minwww',
|
2013-01-04 00:29:55 +00:00
|
|
|
'monotone': 'volunteer/develop/monotone',
|
2013-01-04 01:12:49 +00:00
|
|
|
'myi2p': 'misc/myi2p',
|
2013-01-04 00:29:55 +00:00
|
|
|
'naming': 'docs/naming',
|
2013-01-04 01:12:49 +00:00
|
|
|
'naming_discussion': 'docs/discussions/naming',
|
|
|
|
'netdb_discussion': 'docs/discussions/netdb',
|
2013-01-04 00:29:55 +00:00
|
|
|
'newdevelopers': 'volunteer/guides/newdevelopers',
|
|
|
|
'newtranslators': 'volunteer/guides/newtranslators',
|
|
|
|
'ntcp': 'docs/transport/ntcp',
|
2013-01-04 01:12:49 +00:00
|
|
|
'ntcp_discussion': 'docs/discussions/ntcp',
|
|
|
|
'othernetworks': 'about/comparison/othernetworks',
|
2013-01-04 00:29:55 +00:00
|
|
|
'papers': 'research/papers',
|
2013-01-04 01:12:49 +00:00
|
|
|
'performance-history': 'support/performance/history',
|
2013-01-04 00:29:55 +00:00
|
|
|
'performance': 'support/performance/future',
|
|
|
|
'plugin_spec': 'docs/spec/plugin',
|
2013-01-04 01:12:49 +00:00
|
|
|
'plugins': 'docs/plugins',
|
2013-01-04 00:29:55 +00:00
|
|
|
'ports': 'docs/ports',
|
|
|
|
'protocols': 'docs/protocol',
|
2013-01-04 01:12:49 +00:00
|
|
|
'ratestats': 'misc/ratestats',
|
|
|
|
'release-signing-key': 'volunteer/develop/release-signing-key',
|
2013-01-04 00:29:55 +00:00
|
|
|
'roadmap': 'volunteer/roadmap',
|
|
|
|
'sam': 'docs/api/sam',
|
|
|
|
'samv2': 'docs/api/samv2',
|
|
|
|
'samv3': 'docs/api/samv3',
|
2013-01-04 01:12:49 +00:00
|
|
|
'signedkeys': 'volunteer/develop/signedkeys',
|
2013-01-04 00:29:55 +00:00
|
|
|
'socks': 'docs/api/socks',
|
|
|
|
'streaming': 'docs/api/streaming',
|
2013-01-04 01:12:49 +00:00
|
|
|
'supported_applications': 'docs/applications/supported',
|
2013-01-04 00:29:55 +00:00
|
|
|
'team': 'about/team',
|
|
|
|
'techintro': 'docs/how/techintro',
|
|
|
|
'todo': 'volunteer/todo',
|
2013-01-04 01:12:49 +00:00
|
|
|
'transition-guide': 'misc/transition-guide',
|
|
|
|
'transition-guide.txt': 'misc/transition-guide.txt',
|
2013-01-04 00:29:55 +00:00
|
|
|
'transport': 'docs/transport',
|
|
|
|
'tunnel-alt-creation': 'docs/spec/tunnel_creation',
|
2013-01-04 01:12:49 +00:00
|
|
|
'tunnel-alt': 'docs/tunnels/implementation',
|
|
|
|
'tunnel': 'docs/tunnels/old',
|
|
|
|
'tunnel_discussion': 'docs/discussions/tunnel',
|
2013-01-04 00:29:55 +00:00
|
|
|
'tunnel_message_spec': 'docs/spec/tunnel_message',
|
|
|
|
'udp': 'docs/transport/ssu',
|
|
|
|
'udp_spec': 'docs/spec/ssu',
|
|
|
|
'unidirectional-tunnels': 'docs/tunnels/unidirectional',
|
|
|
|
'updates': 'docs/spec/updates',
|
2013-01-04 01:12:49 +00:00
|
|
|
'upgrade-0.6.1.30': 'misc/upgrade-0.6.1.30',
|
2012-12-19 10:55:11 +00:00
|
|
|
}
|
|
|
|
|
2012-12-19 10:30:49 +00:00
|
|
|
def legacy_show(f):
|
|
|
|
lang = 'en'
|
|
|
|
if hasattr(g, 'lang') and g.lang:
|
|
|
|
lang = g.lang
|
2012-12-19 10:55:11 +00:00
|
|
|
if f in LEGACY_FUNCTIONS_MAP:
|
|
|
|
return redirect(url_for(LEGACY_FUNCTIONS_MAP[f], lang=lang))
|
|
|
|
elif f in LEGACY_PAGES_MAP:
|
|
|
|
return redirect(url_for('site_show', lang=lang, page=LEGACY_PAGES_MAP[f]))
|
2012-12-19 10:30:49 +00:00
|
|
|
else:
|
|
|
|
return redirect(url_for('site_show', lang=lang, page=f))
|
|
|
|
|
|
|
|
def legacy_meeting(id):
|
|
|
|
return redirect(url_for('meetings_show', id=id, lang='en'))
|
|
|
|
|
|
|
|
def legacy_status(year, month, day):
|
|
|
|
return redirect(url_for('blog_entry', lang='en', slug=('%s/%s/%s/status' % (year, month, day))))
|