Metadata-Version: 1.0
Name: pause
Version: 0.1.1
Summary: A timestamp-based sleep function for Python.
Home-page: https://github.com/jgillick/python-pause
Author: Jeremy Gillick
Author-email: none@none.com
License: The MIT License (MIT)

Copyright (c) 2013 Jeremy Gillick

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Description: Python Pause
        ===============
        
        Suspend the execution of your program for a given amount of time. This works similarly to ``time.sleep``, but uses your computers timestamp to track time, versus a counter.
        
        For example, traditionally using ``time.sleep(3600)``, will pause the program for 60 minutes. If your computer goes into standby mode during minute one, and wakes up several hours later, your program will continue to sleep for 59 minutes.
        
        With ``pause.seconds(3600)``, if your computer goes into standby (sleep) mode for several hours, the program will continue immediately after the machine wakes back up since the minimum amount of time has passed since the pause was started.
        
        How it works
        ------------
        
        When you create a pause, it will determine what the end time of that pause should be. Then a loop will be started that will continually check the current time against the end time. When the current time is equal or greater than the end time, the method will return and your program can resume.
        
        Precision
        ---------
        
        The precision *should* be within 0.001 of a second, however, this will depend on how precise your system sleep is and other performance factors.
        
        This module checks the time at various intervals depending on how much time is left on the pause. If there is at least 1.5 seconds left, it will check every second. When the timer gets down to 0.1 seconds, the time will be checked every 0.001 second.
        
        Install
        -------
        
        Download the source code and run the following command::
        
            sudo python ./setup.py install
        
        Or, without downloading, install with `pip <http://www.pip-installer.org/en/latest/>`_::
        
             sudo pip install pause
        
        
        Examples:
        ---------
        
        Pause for half a second::
        
            import pause
            pause.milliseconds(500)
        
        Or::
        
            import pause
            pause.seconds(0.5)
        
        Pause for 1 minute::
        
            import pause
            pause.minute(1)
        
        Pause for 2 days::
        
            import pause
            pause.days(2)
        
        Pause until a unix time, with millisecond precision::
        
            import pause
            pause.until(1370640569.7747359)
        
        Pause using datetime::
        
            import pause, datetime
            dt = datetime.datetime(2013, 6, 2, 14, 36, 34, 383752)
            pause.until(dt)
        
        
        Functions
        ---------
        
        * days(num)
            Pause for this many days
        
        * hours(num)
            Pause for this many hours
        
        * milliseconds(num)
            Pause for this many milliseconds
        
        * minutes(num)
            Pause for this many minutes
        
        * seconds(num)
            Pause for this many seconds
        
        * time(num)
            Same as PauseFor.seconds()
        
        * until(time)
            Pause your program until a specific end time.
            'time' is either a unix timestamp in seconds (i.e. seconds since Unix epoch) or datetime object
        
        * weeks(num)
            Pause for this many weeks
Keywords: sleep timestamp datetime
Platform: osx
Platform: posix
Platform: linux
Platform: windows
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX
Classifier: Environment :: Console
