Charles McLaughlin  committed f06615d

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

  • Participants
  • Parent commits 7100a69
  • Branches master

Comments (0)

Files changed (1)

File bbtools/

 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