Skip to content
Snippets Groups Projects
Commit 62951fb7 authored by nkour's avatar nkour
Browse files

coding standards; convert a TODO to more like testing stuff

parent 1dc069f2
No related branches found
No related tags found
No related merge requests found
## common/nslookup.py ## common/nslookup.py
## ##
## Contributors for this file: ## Copyright (C) 2006 Dimitur Kirov <dkirov@gmail.com>
## - Dimitur Kirov <dkirov@gmail.com>
##
## Copyright (C) 2003-2004 Yann Le Boulanger <asterix@lagaule.org>
## Vincent Hanquez <tab@snarc.org>
## Copyright (C) 2006 Yann Le Boulanger <asterix@lagaule.org>
## Vincent Hanquez <tab@snarc.org>
## Nikos Kouremenos <nkour@jabber.org>
## Dimitur Kirov <dkirov@gmail.com>
## Travis Shirk <travis@pobox.com>
## Norman Rasmussen <norman@rasmussen.co.za>
## ##
## This program is free software; you can redistribute it and/or modify ## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published ## it under the terms of the GNU General Public License as published
...@@ -22,13 +12,17 @@ ...@@ -22,13 +12,17 @@
## GNU General Public License for more details. ## GNU General Public License for more details.
## ##
import sys, os, sre import sys
import os
import sre
from xmpp.idlequeue import * from xmpp.idlequeue import *
if os.name == 'nt': if os.name == 'nt':
from subprocess import * from subprocess import * # python24 only. we ask this for Windows
elif os.name == 'posix': elif os.name == 'posix':
import fcntl import fcntl
# it is good to check validity of arguments, when calling system commands # it is good to check validity of arguments, when calling system commands
ns_type_pattern = sre.compile('^[a-z]+$') ns_type_pattern = sre.compile('^[a-z]+$')
...@@ -292,7 +286,7 @@ class NsLookup(IdleCommand): ...@@ -292,7 +286,7 @@ class NsLookup(IdleCommand):
self.result_handler(self.host, self.result) self.result_handler(self.host, self.result)
self.result_handler = None self.result_handler = None
# TODO: remove below lines if there is nothing more to test # below lines is on how to use API and assist in testing
if __name__ == '__main__': if __name__ == '__main__':
if os.name == 'posix': if os.name == 'posix':
idlequeue = IdleQueue() idlequeue = IdleQueue()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment