# Parse options twice: first to get the project and second to handle
# defaults properly (which depends on project).
(options, args) = parser.parse_args()
-settings.Setup(parser, options.project, '')
+settings.Setup(gitutil, parser, options.project, '')
(options, args) = parser.parse_args()
if __name__ != "__main__":
import re
from patman import command
-from patman import gitutil
from patman import tools
"""Default settings per-project.
fd.close()
-def CreatePatmanConfigFile(config_fname):
+def CreatePatmanConfigFile(gitutil, config_fname):
"""Creates a config file under $(HOME)/.patman if it can't find one.
Args:
except:
raise
-def Setup(parser, project_name, config_fname=''):
+def Setup(gitutil, parser, project_name, config_fname=''):
"""Set up the settings module by reading config files.
Args:
if not os.path.exists(config_fname):
print("No config file found ~/.patman\nCreating one...\n")
- CreatePatmanConfigFile(config_fname)
+ CreatePatmanConfigFile(gitutil, config_fname)
config.read(config_fname)