예제 #1
0
        finally:
            page_put_queue.mutex.release()
    page_put_queue.put((request, args, kwargs))


# queue to hold pending requests
page_put_queue = Queue(config.max_queue_size)
# queue to signal that async_manager is working on a request. See T147178.
page_put_queue_busy = Queue(config.max_queue_size)
# set up the background thread
_putthread = threading.Thread(target=async_manager)
# identification for debugging purposes
_putthread.setName('Put-Thread')
_putthread.setDaemon(True)

wrapper = _ModuleDeprecationWrapper(__name__)
wrapper._add_deprecated_attr('ImagePage', FilePage, since='20140924')
wrapper._add_deprecated_attr(
    'cookie_jar', replacement_name='pywikibot.comms.http.cookie_jar',
    since='20150921')
wrapper._add_deprecated_attr(
    'PageNotFound', _DeprecatedPageNotFoundError,
    warning_message=('{0}.{1} is deprecated, and no longer '
                     'used by pywikibot; use http.fetch() instead.'),
    since='20140924')
wrapper._add_deprecated_attr(
    'UserActionRefuse', _EmailUserError,
    warning_message='UserActionRefuse is deprecated; '
                    'use UserRightsError and/or NotEmailableError instead.',
    since='20141218')
wrapper._add_deprecated_attr(
예제 #2
0
            except (AssertionError, RuntimeError):
                pass
        finally:
            page_put_queue.mutex.release()
    page_put_queue.put((request, args, kwargs))


# queue to hold pending requests
page_put_queue = Queue(config.max_queue_size)
# set up the background thread
_putthread = threading.Thread(target=async_manager)
# identification for debugging purposes
_putthread.setName('Put-Thread')
_putthread.setDaemon(True)

wrapper = _ModuleDeprecationWrapper(__name__)
wrapper._add_deprecated_attr('ImagePage', FilePage)
wrapper._add_deprecated_attr(
    'cookie_jar', replacement_name='pywikibot.comms.http.cookie_jar')
wrapper._add_deprecated_attr(
    'PageNotFound', _DeprecatedPageNotFoundError,
    warning_message=('{0}.{1} is deprecated, and no longer '
                     'used by pywikibot; use http.fetch() instead.'))
wrapper._add_deprecated_attr(
    'UserActionRefuse', _EmailUserError,
    warning_message='UserActionRefuse is deprecated; '
                    'use UserRightsError and/or NotEmailableError instead.')
wrapper._add_deprecated_attr(
    'QuitKeyboardInterrupt', _QuitKeyboardInterrupt,
    warning_message='pywikibot.QuitKeyboardInterrupt is deprecated; '
                    'use pywikibot.bot.QuitKeyboardInterrupt instead.')