def _configure_profile(self, name, opts):
     if self.config.current_profile:
         # save current settings if a profile is active
         self.config.current_profile.write()
     
     profile = MobileProfile.from_dict(name, opts)
     self.load_profile(profile)
 def _initialize_profile(self):
     name = self.get('profile', 'name')
     # name might not be set if we've just started
     if name:
         profile = MobileProfile.from_name(name)
         self.set_current_profile(profile)
 def get_profile_list(self):
     """
     Returns all the stored profiles as a list of C{MobileProfile} objects
     """
     return [MobileProfile.from_name(name, self.path)
                         for name in os.listdir(self.path)]
 def create_profile(self, name, opts):
     """
     Creates a new mobile profile with C{name} from the C{opts} dict
     """
     return MobileProfile.from_dict(name, opts, path=self.path)
 def get_profile_list(self):
     """
     Returns all the stored profiles as a list of C{MobileProfile} objects
     """
     return [MobileProfile.from_name(name, self.path)
                         for name in os.listdir(self.path)]
 def create_profile(self, name, opts):
     """
     Creates a new mobile profile with C{name} from the C{opts} dict
     """
     return MobileProfile.from_dict(name, opts, path=self.path)
示例#7
0
 def _initialize_profile(self):
     name = self.get('profile', 'name')
     # name might not be set if we've just started
     if name:
         profile = MobileProfile.from_name(name)
         self.set_current_profile(profile)