Skip to content

Commit

Permalink
remove TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
Xyntax committed Sep 8, 2016
1 parent 2c36a28 commit 0a26855
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 35 deletions.
7 changes: 1 addition & 6 deletions lib/controller/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,7 @@ def resultHandler(status, payload):
elif status is True or status is POC_RESULT_STATUS.SUCCESS:
msg = payload
else:
# TODO handle this exception
try:
msg = str(status)
except Exception, e:
printMessage(e)
return
msg = str(status)
changeFoundCount(1)
if th.s_flag:
printMessage(msg)
Expand Down
1 change: 0 additions & 1 deletion lib/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ def pollProcess(process, suppress_errors=False):
if returncode is not None:
if not suppress_errors:
if returncode == 0:
# TODO print导致线程资源不安全
print " done\n"
elif returncode < 0:
print " process terminated by signal %d\n" % returncode
Expand Down
24 changes: 6 additions & 18 deletions lib/core/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,43 +13,31 @@
logging.addLevelName(CUSTOM_LOGGING.ERROR, "-")
logging.addLevelName(CUSTOM_LOGGING.WARNING, "!")

LOGGER = logging.getLogger("pocketLog")
LOGGER = logging.getLogger("TookitLogger")

LOGGER_HANDLER = None
try:
from thirdparty.ansistrm.ansistrm import ColorizingStreamHandler

disableColor = False

# TODO disable_color in parser.py
for argument in sys.argv:
if "disable-col" in argument:
disableColor = True
break

if disableColor:
LOGGER_HANDLER = logging.StreamHandler(sys.stdout)
else:
try:
LOGGER_HANDLER = ColorizingStreamHandler(sys.stdout)
LOGGER_HANDLER.level_map[logging.getLevelName("*")] = (None, "cyan", False)
LOGGER_HANDLER.level_map[logging.getLevelName("+")] = (None, "green", False)
LOGGER_HANDLER.level_map[logging.getLevelName("-")] = (None, "red", False)
LOGGER_HANDLER.level_map[logging.getLevelName("!")] = (None, "yellow", False)
except Exception:
LOGGER_HANDLER = logging.StreamHandler(sys.stdout)

except ImportError:
LOGGER_HANDLER = logging.StreamHandler(sys.stdout)

# there can't be -> if conf.DEBUG:
if "debug" in sys.argv:
FORMATTER = logging.Formatter("\r[%(asctime)s] [%(levelname)s] %(message)s", "%H:%M:%S")
else:
FORMATTER = logging.Formatter("\r[%(levelname)s] %(message)s", "%H:%M:%S")
FORMATTER = logging.Formatter("\r[%(levelname)s] %(message)s", "%H:%M:%S")

LOGGER_HANDLER.setFormatter(FORMATTER)
LOGGER.addHandler(LOGGER_HANDLER)
LOGGER.setLevel(CUSTOM_LOGGING.WARNING)


# TODO 为log level做判断,类似sqlmap的-v参数
class MY_LOGGER:
@staticmethod
def success(msg):
Expand Down
3 changes: 0 additions & 3 deletions lib/core/option.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ def initOptions(args):

def checkUpdate(args):
if args.sys_update:
# TODO remove
print 'update?'
raw_input('!!!')
update()


Expand Down
2 changes: 1 addition & 1 deletion lib/parse/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

def cmdLineParser():
parser = argparse.ArgumentParser(description='powered by cdxy <mail:[email protected]> ',
usage='python POC-T.py -s bingc -aZ "port:8080" -oF', # TODO add usage here
usage='python POC-T.py -s bingc -aZ "port:8080"',
add_help=False)

engine = parser.add_argument_group('ENGINE')
Expand Down
7 changes: 1 addition & 6 deletions lib/utils/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from subprocess import Popen as execute
from lib.core.common import getSafeExString
from lib.core.common import pollProcess
from lib.core.data import conf
from lib.core.data import logger
from lib.core.data import paths
from lib.core.settings import GIT_REPOSITORY
Expand All @@ -20,11 +19,7 @@


def update():
if not conf.UPDATE:
return

success = False

if not os.path.exists(os.path.join(paths.ROOT_PATH, ".git")):
errMsg = "not a git repository. Please checkout the 'Xyntax/POC-T' repository "
errMsg += "from GitHub (e.g. 'git clone https://github.com/Xyntax/POC-T.git POC-T')"
Expand All @@ -35,7 +30,7 @@ def update():
logger.info(infoMsg)

debugMsg = "POC-T will try to update itself using 'git' command"
logger.debug(debugMsg)
logger.info(debugMsg)

logger.info("update in progress ")

Expand Down

0 comments on commit 0a26855

Please sign in to comment.