def timeMachine_currentlyTravelingDateObject(request): currentlyTravelingTo = cookie.currentlyTravelingTo(request) return mark_safe( "new Date( %s, %s, %s, %s, %s, %s )" % (currentlyTravelingTo.year, currentlyTravelingTo.month - 1, currentlyTravelingTo.day, currentlyTravelingTo.hour, currentlyTravelingTo.minute, currentlyTravelingTo.second))
def timeMachine_currentlyTravelingDateObject( request ): currentlyTravelingTo = cookie.currentlyTravelingTo( request ) return mark_safe( "new Date( %s, %s, %s, %s, %s, %s )" % ( currentlyTravelingTo.year, currentlyTravelingTo.month - 1, currentlyTravelingTo.day, currentlyTravelingTo.hour, currentlyTravelingTo.minute, currentlyTravelingTo.second ) )
def _new( request, * args, ** kwargs ): if cookie.currentlyTraveling( request ): localThreadStorage.currentlyTravelingTo = cookie.currentlyTravelingTo( request ) try: return method( request, * args, ** kwargs ) finally: del localThreadStorage.currentlyTravelingTo else: assert not hasattr( localThreadStorage, 'currentlyTravelingTo' ) return method( request, * args, ** kwargs )
def _new(request, *args, **kwargs): if cookie.currentlyTraveling(request): localThreadStorage.currentlyTravelingTo = cookie.currentlyTravelingTo( request) try: return method(request, *args, **kwargs) finally: del localThreadStorage.currentlyTravelingTo else: assert not hasattr(localThreadStorage, 'currentlyTravelingTo') return method(request, *args, **kwargs)
def travelToMinute( request, minute ): response = shortcuts.redirect( "/timemachine" ) currently = cookie.currentlyTravelingTo( request ) when = datetime.datetime.combine( currently.date(), datetime.time( currently.hour, int( minute ), 59 ) ) return cookie.travelToDateTime( response, when )
def travelToMinute(request, minute): response = shortcuts.redirect("/timemachine") currently = cookie.currentlyTravelingTo(request) when = datetime.datetime.combine( currently.date(), datetime.time(currently.hour, int(minute), 59)) return cookie.travelToDateTime(response, when)