Beispiel #1
0
    def startup(self, space):
        # this machinery is needed to expose constants
        # that have to be initialized one time only
        from pypy.module.rctime import interp_time

        interp_time._init_timezone(space)
        interp_time._init_accept2dyear(space)
Beispiel #2
0
    def buildloaders(cls):
        from pypy.module.rctime import interp_time
        import os
        
        if os.name == "posix":
            Module.interpleveldefs['tzset'] = 'interp_time.tzset'

        # this machinery is needed to expose constants
        # that have to be initialized one time only
        
        Module.interpleveldefs["accept2dyear"] = 'space.wrap(%r)' %\
            interp_time._init_accept2dyear()
        
        timezone, daylight, tzname, altzone = interp_time._init_timezone()
        Module.interpleveldefs['timezone'] = 'space.wrap(%r)' % timezone
        Module.interpleveldefs['daylight'] = 'space.wrap(%r)' % daylight
        Module.interpleveldefs['tzname'] = \
            'space.newlist([space.wrap(%r), space.wrap(%r)])' % tuple(tzname)
        Module.interpleveldefs['altzone'] = 'space.wrap(%r)' % altzone
        super(Module, cls).buildloaders()