我有以下代码,我认为它很臭,因为vi
. 我怎样才能写得更好?
vi = '([a-zA-Z0-9_\-\.]+)'
handlers = [
(r'/register', RegistrationHandler),
(r'/profiles/%s/%s' % (vi, vi), GetProfiles),
(r'/archives/%s/%s/%s/%s' % (vi, vi, vi, vi), GetArchives),
(r'/publish-profiles', PublishProfiles),
(r'/publish-bundle/%s/%s' % (vi, vi), PublishBundle),
(r'/upload-file/%s/%s/%s' % (vi, vi, vi), UploadFile),
(r"/favicon\.ico", tornado.web.StaticFileHandler, dict(path=settings['static_path'])),
]