示例#1
0
文件: config.py 项目: kgiusti/gofer
 def read(self, fp):
     """
     Read the file and return a dictionary.
     :param fp: An open file descriptor.
     :type fp: file
     :return: The parsed file.
     :rtype: dict
     """
     try:
         return json.load(fp)
     except ValueError:
         return {}
示例#2
0
    def __call__(self):
        """
        Read the file and return a dictionary.

        :return: The parsed file.
        :rtype: dict
        """
        try:
            fp = self.fp
            return json.load(fp)
        except (TypeError, ValueError):
            return {}
示例#3
0
文件: config.py 项目: seandst/gofer
    def __call__(self):
        """
        Read the file and return a dictionary.

        :return: The parsed file.
        :rtype: dict
        """
        try:
            fp = self.fp
            return json.load(fp)
        except (TypeError, ValueError):
            return {}
示例#4
0
文件: config.py 项目: pombreda/gofer
 def read(self, fp):
     """
     Read the file and return a dictionary.
     :param fp: An open file descriptor.
     :type fp: file
     :return: The parsed file.
     :rtype: dict
     """
     try:
         return json.load(fp)
     except ValueError:
         return {}