예제 #1
0
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))
예제 #2
0
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 ) )
예제 #3
0
		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 )
예제 #4
0
 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)
예제 #5
0
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 )
예제 #6
0
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)