Skip to content

Commit

Permalink
pylint stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
alenz33 committed Mar 31, 2015
1 parent eb1f4a8 commit 391e983
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 38 deletions.
13 changes: 9 additions & 4 deletions conduct.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,21 @@
#
# *****************************************************************************

'''
conduct's main script.
Handles all command line arguments, creates and executes the given chain.
'''

import sys
import os
import logging
import argparse

import conduct

from conduct import loggers, config
from conduct import loggers
from conduct.chain import Chain
from conduct.util import loadChainDefinition, loadChainConfig, chainPathToName
from conduct.util import loadChainDefinition, loadChainConfig, \
chainPathToName, loadConductConf

def processGlobalArgs(parser, argv):
'''
Expand Down Expand Up @@ -58,7 +63,7 @@ def processGlobalArgs(parser, argv):

# init config
# load and store global config
conduct.cfg = config.loadConductConf(globalArgs.global_config)
conduct.cfg = loadConductConf(globalArgs.global_config)

# handle help stuff
if globalArgs.help and not specArgs:
Expand Down
34 changes: 0 additions & 34 deletions conduct/config.py

This file was deleted.

11 changes: 11 additions & 0 deletions conduct/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import subprocess

from collections import OrderedDict
from ConfigParser import SafeConfigParser
from os import path

import conduct
Expand Down Expand Up @@ -82,6 +83,16 @@ def __getattr__(self, name):

## Util funcs

def loadConductConf(path='/etc/conduct.conf'):
parser = SafeConfigParser()
parser.readfp(open(path))

cfg = {'conduct' : {
option : value for option, value in parser.items('conduct')
}}

return cfg

def logMultipleLines(strOrList, logFunc=None):
if logFunc is None:
logFunc = conduct.log.info
Expand Down

0 comments on commit 391e983

Please sign in to comment.