old_contents: #
  # Copyright (C) 2012, 2013 Satoru SATOH <ssato @ redhat.com>
  # License: MIT
  #
  import glob
  import os.path
  import types
  
  
  def get_file_extension(file_path):
      """
      >>> get_file_extension("/a/b/c")
      ''
      >>> get_file_extension("/a/b.txt")
      'txt'
      >>> get_file_extension("/a/b/c.tar.xz")
      'xz'
      """
      _ext = os.path.splitext(file_path)[-1]
      if _ext:
          return _ext[1:] if _ext.startswith('.') else _ext
      else:
          return ""
  
  
  def sglob(files_pattern):
      return sorted(glob.glob(files_pattern))
  
  
  def is_iterable(x):
      """
  
      >>> is_iterable([])
      True
      >>> is_iterable(())
      True
      >>> is_iterable([x for x in range(10)])
      True
      >>> is_iterable((1, 2, 3))
      True
      >>> g = (x for x in range(10))
      >>> is_iterable(g)
      True
      >>> is_iterable("abc")
      False
      >>> is_iterable(0)
      False
      >>> is_iterable({})
      False
      """
      return isinstance(x, (list, tuple, types.GeneratorType)) or \
          not isinstance(x, (int, str, dict))
  
  # vim:sw=4:ts=4:et:
  
new_contents: #
  # Copyright (C) 2012, 2013 Satoru SATOH <ssato @ redhat.com>
  # License: MIT
  #
  import glob
  import os.path
  import types
  
  
  def get_file_extension(file_path):
      """
      >>> get_file_extension("/a/b/c")
      ''
      >>> get_file_extension("/a/b.txt")
      'txt'
      >>> get_file_extension("/a/b/c.tar.xz")
      'xz'
      """
      _ext = os.path.splitext(file_path)[-1]
      if _ext:
          return _ext[1:] if _ext.startswith('.') else _ext
      else:
          return ""
  
  
  def sglob(files_pattern):
      return sorted(glob.glob(files_pattern))
  
  
  def is_iterable(x):
      """
  
      >>> is_iterable([])
      True
      >>> is_iterable(())
      True
      >>> is_iterable([x for x in range(10)])
      True
      >>> is_iterable((1, 2, 3))
      True
      >>> g = (x for x in range(10))
      >>> is_iterable(g)
      True
      >>> is_iterable("abc")
      False
      >>> is_iterable(0)
      False
      >>> is_iterable({})
      False
      """
      return isinstance(x, (list, tuple, types.GeneratorType)) or \
          (not isinstance(x, (int, str, dict)) and
           bool(getattr(x, "next", False)))
  
  # vim:sw=4:ts=4:et:
  
subject: revert previous commit causing conversion error in json backend