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-07 04:43:34 +00:00
|
|
|
'announcements': {'function': 'blog_index', 'params': {}},
|
|
|
|
'debian': {'function': 'downloads_select', 'params': {'file': 'debian'}},
|
|
|
|
'download': {'function': 'downloads_list', 'params': {}},
|
|
|
|
'statusnotes': {'function': 'blog_index', 'params': {}},
|
2012-12-19 10:30:49 +00:00
|
|
|
}
|
|
|
|
|
2012-12-19 10:55:11 +00:00
|
|
|
LEGACY_PAGES_MAP={
|
2013-06-04 13:16:58 +00:00
|
|
|
'applications': 'get-involved/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',
|
2013-06-04 13:16:58 +00:00
|
|
|
'bounties': 'get-involved/bounties',
|
|
|
|
'bounty_arabic': 'get-involved/bounties/arabic-trans',
|
|
|
|
'bounty_btcclient': 'get-involved/bounties/btc-client',
|
|
|
|
'bounty_datastore': 'get-involved/bounties/datastore',
|
|
|
|
'bounty_debpack': 'get-involved/bounties/deb-pack',
|
|
|
|
'bounty_i2phex': 'get-involved/bounties/i2phex',
|
|
|
|
'bounty_ipv6': 'get-involved/bounties/ipv6',
|
|
|
|
'bounty_rutrans': 'get-involved/bounties/russian-trans',
|
|
|
|
'bounty_silc': 'get-involved/bounties/silc',
|
|
|
|
'bounty_syndie2012': 'get-involved/bounties/syndie-2012',
|
|
|
|
'bounty_unittests': 'get-involved/bounties/unit-tests',
|
|
|
|
'bounty_vuzeplugin': 'get-involved/bounties/vuze-plugin',
|
2013-01-04 01:12:49 +00:00
|
|
|
'clt': 'misc/clt',
|
2013-01-04 04:46:14 +00:00
|
|
|
'common_structures_spec': 'docs/spec/common-structures',
|
2013-01-04 00:29:55 +00:00
|
|
|
'configuration': 'docs/spec/configuration',
|
2013-01-04 01:12:49 +00:00
|
|
|
'contact': 'about/contact',
|
|
|
|
'cvs': 'misc/cvs',
|
2013-02-05 23:32:57 +00:00
|
|
|
'datagrams': 'docs/api/datagrams',
|
2013-06-04 13:16:58 +00:00
|
|
|
'dev-guidelines': 'get-involved/guides/dev-guidelines',
|
|
|
|
'developerskeys': 'get-involved/develop/developers-keys',
|
|
|
|
'donate': 'get-involved/donate',
|
2013-01-04 00:29:55 +00:00
|
|
|
'faq': 'support/faq',
|
2013-06-04 13:16:58 +00:00
|
|
|
'getinvolved': 'get-involved',
|
2013-01-04 01:12:49 +00:00
|
|
|
'glossary': 'support/glossary',
|
2013-01-04 04:46:14 +00:00
|
|
|
'halloffame': 'about/hall-of-fame',
|
2013-01-04 00:29:55 +00:00
|
|
|
'how': 'docs',
|
|
|
|
'how_cryptography': 'docs/how/cryptography',
|
2013-01-04 04:46:14 +00:00
|
|
|
'how_elgamalaes': 'docs/how/elgamal-aes',
|
|
|
|
'how_garlicrouting': 'docs/how/garlic-routing',
|
2013-01-04 00:29:55 +00:00
|
|
|
'how_intro': 'docs/how/intro',
|
|
|
|
'how_networkcomparisons': 'about/comparison',
|
2013-01-04 04:46:14 +00:00
|
|
|
'how_networkdatabase': 'docs/how/network-database',
|
|
|
|
'how_peerselection': 'docs/how/peer-selection',
|
|
|
|
'how_threatmodel': 'docs/how/threat-model',
|
|
|
|
'how_tunnelrouting': 'docs/how/tunnel-routing',
|
|
|
|
'htproxyports': 'support/browser-config',
|
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 04:46:14 +00:00
|
|
|
'i2ptunnel_migration': 'misc/i2ptunnel-migration',
|
|
|
|
'i2ptunnel_services': 'misc/i2ptunnel-services',
|
2013-01-04 01:12:49 +00:00
|
|
|
'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',
|
2013-06-04 13:16:58 +00:00
|
|
|
'license-agreements': 'get-involved/develop/license-agreements',
|
|
|
|
'licenses': 'get-involved/develop/licenses',
|
2013-01-04 01:12:49 +00:00
|
|
|
'links': 'links',
|
2013-01-04 04:46:14 +00:00
|
|
|
'manualwrapper': 'misc/manual-wrapper',
|
2013-01-04 01:12:49 +00:00
|
|
|
'ministreaming': 'docs/api/ministreaming',
|
|
|
|
'minwww': 'misc/minwww',
|
2013-06-04 13:16:58 +00:00
|
|
|
'monotone': 'get-involved/guides/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-06-04 13:16:58 +00:00
|
|
|
'newdevelopers': 'get-involved/guides/new-developers',
|
|
|
|
'newtranslators': 'get-involved/guides/new-translators',
|
2013-01-04 00:29:55 +00:00
|
|
|
'ntcp': 'docs/transport/ntcp',
|
2013-01-04 01:12:49 +00:00
|
|
|
'ntcp_discussion': 'docs/discussions/ntcp',
|
2013-01-04 04:46:14 +00:00
|
|
|
'othernetworks': 'about/comparison/other-networks',
|
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',
|
2013-06-04 13:16:58 +00:00
|
|
|
'release-signing-key': 'get-involved/develop/release-signing-key',
|
|
|
|
'roadmap': 'get-involved/roadmap',
|
2013-01-04 00:29:55 +00:00
|
|
|
'sam': 'docs/api/sam',
|
|
|
|
'samv2': 'docs/api/samv2',
|
|
|
|
'samv3': 'docs/api/samv3',
|
2013-06-04 13:16:58 +00:00
|
|
|
'signedkeys': 'get-involved/develop/signed-keys',
|
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',
|
2013-01-04 04:46:14 +00:00
|
|
|
'techintro': 'docs/how/tech-intro',
|
2013-05-24 02:11:52 +00:00
|
|
|
'ticket919': 'misc/ticket919',
|
2013-06-04 13:16:58 +00:00
|
|
|
'todo': 'get-involved/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',
|
2013-01-04 04:46:14 +00:00
|
|
|
'tunnel-alt-creation': 'docs/spec/tunnel-creation',
|
2013-01-04 01:12:49 +00:00
|
|
|
'tunnel-alt': 'docs/tunnels/implementation',
|
2013-01-04 04:46:14 +00:00
|
|
|
'tunnel': 'docs/tunnels/old-implementation',
|
2013-01-04 01:12:49 +00:00
|
|
|
'tunnel_discussion': 'docs/discussions/tunnel',
|
2013-01-04 04:46:14 +00:00
|
|
|
'tunnel_message_spec': 'docs/spec/tunnel-message',
|
2013-01-04 00:29:55 +00:00
|
|
|
'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:
|
2013-01-07 04:43:34 +00:00
|
|
|
return redirect(url_for(LEGACY_FUNCTIONS_MAP[f]['function'], lang=lang, **LEGACY_FUNCTIONS_MAP[f]['params']))
|
2012-12-19 10:55:11 +00:00
|
|
|
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):
|
2013-01-09 00:32:32 +00:00
|
|
|
return redirect(url_for('blog_post', lang='en', slug=('%s/%s/%s/status' % (year, month, day))))
|