Ability to have username in init command
[mw] / src / mw / metadir.py
index 18811db26b38359b8adca2c71d517d53ad29895e..6c6bfeb1e2d45417e132d8dc8e552817353e68f0 100644 (file)
@@ -49,7 +49,7 @@ class Metadir(object):
         else:
             self.config = None
 
-    def create(self, api_url):
+    def create(self, api_url, username=None):
         # create the directory
         if os.path.isdir(self.location):
             print '%s: you are already in a mw repo' % self.me
@@ -64,6 +64,8 @@ class Metadir(object):
         self.config = ConfigParser.RawConfigParser()
         self.config.add_section('remote')
         self.config.set('remote', 'api_url', api_url)
+        if username != None:
+            self.config.set('remote', 'username', username)
         with open(self.config_loc, 'wb') as config_file:
             self.config.write(config_file)
         # create cache/

Benjamin Mako Hill || Want to submit a patch?