我一直在使用python dns模块.我试图在新的Linux安装上使用它,但模块没有加载.我试图清理和安装,但安装似乎没有工作.
$ python --version
Python 2.7.3
$ sudo pip install dnspython
Downloading/unpacking dnspython
Downloading dnspython-1.11.1.zip (220Kb): 220Kb downloaded
Running setup.py egg_info for package dnspython
Installing collected packages: dnspython
Running setup.py install for dnspython
Successfully installed dnspython
Cleaning up...
$ python
Python 2.7.3 (default, Sep 26 2013, 20:03:06)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dns
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named dns
更新了python版本和pip版本命令的输出
$ … I wanted to do so custom logic(Record the request and response) on some routes. Based on some research I came decided to use AnnotationBased RequestInterceptor. This is my code for interceptor.
public class CustomInterceptor extends HandlerInterceptorAdapter {
@Override
public void afterCompletion(final HttpServletRequest request,
final HttpServletResponse response,
final Object handler,
final Exception ex) {
if (handler != null && handler instanceof HandlerMethod) {
HandlerMethod handlerMethod = (HandlerMethod) handler;
CustomRecord annotation = AnnotationUtils.getAnnotation(handlerMethod.getMethod(), CustomRecord.class);
if (annotation != null) {
// Record Request …Run Code Online (Sandbox Code Playgroud) java ×1
mockito ×1
module ×1
powermockito ×1
python ×1
python-2.7 ×1
resolver ×1
spring ×1
unit-testing ×1