def __init__(self, preferences_file=None):
        """Create a preferences object.

        This JSSPrefs object can be used as an argument for a new JSS.
        By default and with no arguments, it uses the preference domain
        "com.github.sheagcraig.python-jss.plist". However, alternate
        configurations can be supplied to the __init__ method to use
        something else.

        If no preferences file is specified, an interactive config
        method will run to help set up python-jss.

        See the JSSPrefs __doc__ for information on supported
        preferences.

        Args:
            preferences_file: String path to an alternate location to
            look for preferences. Defaults base on OS:
                OS X: "~/Library/Preferences/com.github.sheagcraig.python-jss.plist"
                Linux: "~/.com.github.sheagcraig.python-jss.plist"

        Raises:
            JSSError if using an unsupported OS.
        """
        if (preferences_file is not None and not
                os.path.exists(os.path.expanduser(preferences_file))):
            raise JSSPrefsMissingFileError("Preferences file not found!")
        if preferences_file is None:
            plist_name = "com.github.sheagcraig.python-jss.plist"
            if is_osx():
                preferences_file = os.path.join("~", "Library", "Preferences",
                                                plist_name)
            elif is_linux():
                preferences_file = os.path.join("~", "." + plist_name)
            else:
                raise JSSError("Unsupported OS.")

        self.preferences_file = os.path.expanduser(preferences_file)
        if os.path.exists(self.preferences_file):
            self.parse_plist(self.preferences_file)

        else:
            self.configure()
            if not os.path.exists(self.preferences_file):
                raise JSSPrefsMissingFileError("Preferences file not found!")
            else:
                self.__init__()
def __init__ ( self , preferences_file = None ) : if ( preferences_file is not None and not os . path . exists ( os . path . expanduser ( preferences_file ) ) ) : raise JSSPrefsMissingFileError ( "Preferences file not found!" ) if preferences_file is None : plist_name = "com.github.sheagcraig.python-jss.plist" if is_osx ( ) : preferences_file = os . path . join ( "~" , "Library" , "Preferences" , plist_name ) elif is_linux ( ) : preferences_file = os . path . join ( "~" , "." + plist_name ) else : raise JSSError ( "Unsupported OS." ) self . preferences_file = os . path . expanduser ( preferences_file ) if os . path . exists ( self . preferences_file ) : self . parse_plist ( self . preferences_file ) else : self . configure ( ) if not os . path . exists ( self . preferences_file ) : raise JSSPrefsMissingFileError ( "Preferences file not found!" ) else : self . __init__ ( )
Create a preferences object.

        This JSSPrefs object can be used as an argument for a new JSS.
        By default and with no arguments, it uses the preference domain
        "com.github.sheagcraig.python-jss.plist". However, alternate
        configurations can be supplied to the __init__ method to use
        something else.

        If no preferences file is specified, an interactive config
        method will run to help set up python-jss.

        See the JSSPrefs __doc__ for information on supported
        preferences.

        Args:
            preferences_file: String path to an alternate location to
            look for preferences. Defaults base on OS:
                OS X: "~/Library/Preferences/com.github.sheagcraig.python-jss.plist"
                Linux: "~/.com.github.sheagcraig.python-jss.plist"

        Raises:
            JSSError if using an unsupported OS.