Commits

Charles McLaughlin committed f06615d

Added a check looking for the config file and user-friendly instructions if it's not found

Comments (0)

Files changed (1)

 import os
-
+import sys
 from configobj import ConfigObj
 
 def get_config():
 	fn = os.path.expanduser('~/.bbtools')
+	if not os.path.isfile(fn):
+		sys.exit('You need a ~/.bbtools config file of the form:\n'
+			 '[user]\n'
+			 'username = <your_bb_username>\n'
+			 'password = <your_bb_password>\n')
 
 	return ConfigObj(fn)
 
 	
 	cfg = get_config()
 
-	return cfg.get('user').get('username')+'/'+s
+	return cfg.get('user').get('username')+'/'+s