import os
import io
import errno
from xdg import BaseDirectory
from .common import ProviderError


class Record(object):
    def __init__(self, *path):
        data_dir = BaseDirectory.save_data_path('lab', 'v1', *path[:-1])
        self.path = os.path.join(data_dir, path[-1])

        try:
            with io.open(self.path, 'r') as fp:
                self.data = fp.read()
        except IOError as e:
            if e.errno == errno.ENOENT:
                self.data = None
            else:
                raise ProviderError(e)

    def push(self, data):
        with io.open(self.path, 'w', encoding='utf-8') as fp:
            return fp.write(data)


class FileProvider(object):
    name = 'files'

    def __init__(self, config):
        pass

    def get(self, *path):
        return Record(*path)

import os
import io
import errno
from xdg import BaseDirectory
from .common import ProviderError


class Record(object):
    def __init__(self, *path):
        data_dir = BaseDirectory.save_data_path('lab', 'v1', *path[:-1])
        self.path = os.path.join(data_dir, path[-1])

        try:
            with io.open(self.path, 'r') as fp:
                self.data = fp.read()
        except IOError as e:
            if e.errno == errno.ENOENT:
                self.data = None
            else:
                raise ProviderError(e)

    def push(self, data):
        with io.open(self.path, 'w', encoding='utf-8') as fp:
            return fp.write(data)


class FileProvider(object):
    name = 'files'

    def __init__(self, config):
        # We don't support and configuration, so intentionally empty
        pass

    def get(self, *path):
        return Record(*path)

Add comment on FileProvider init
Add comment on FileProvider init

I swear I added this prior to merging, somehow slipped through. Sorry

  import os
  import io
  import errno
  from xdg import BaseDirectory
  from .common import ProviderError
  
  
  class Record(object):
      def __init__(self, *path):
          data_dir = BaseDirectory.save_data_path('lab', 'v1', *path[:-1])
          self.path = os.path.join(data_dir, path[-1])
  
          try:
              with io.open(self.path, 'r') as fp:
                  self.data = fp.read()
          except IOError as e:
              if e.errno == errno.ENOENT:
                  self.data = None
              else:
                  raise ProviderError(e)
  
      def push(self, data):
          with io.open(self.path, 'w', encoding='utf-8') as fp:
              return fp.write(data)
  
  
  class FileProvider(object):
      name = 'files'
  
      def __init__(self, config):
+         # We don't support and configuration, so intentionally empty
          pass
  
      def get(self, *path):
          return Record(*path)
  
Add comment on FileProvider init
## Code Before:
import os
import io
import errno
from xdg import BaseDirectory
from .common import ProviderError


class Record(object):
    def __init__(self, *path):
        data_dir = BaseDirectory.save_data_path('lab', 'v1', *path[:-1])
        self.path = os.path.join(data_dir, path[-1])

        try:
            with io.open(self.path, 'r') as fp:
                self.data = fp.read()
        except IOError as e:
            if e.errno == errno.ENOENT:
                self.data = None
            else:
                raise ProviderError(e)

    def push(self, data):
        with io.open(self.path, 'w', encoding='utf-8') as fp:
            return fp.write(data)


class FileProvider(object):
    name = 'files'

    def __init__(self, config):
        pass

    def get(self, *path):
        return Record(*path)

## Instruction:
Add comment on FileProvider init
## Code After:
import os
import io
import errno
from xdg import BaseDirectory
from .common import ProviderError


class Record(object):
    def __init__(self, *path):
        data_dir = BaseDirectory.save_data_path('lab', 'v1', *path[:-1])
        self.path = os.path.join(data_dir, path[-1])

        try:
            with io.open(self.path, 'r') as fp:
                self.data = fp.read()
        except IOError as e:
            if e.errno == errno.ENOENT:
                self.data = None
            else:
                raise ProviderError(e)

    def push(self, data):
        with io.open(self.path, 'w', encoding='utf-8') as fp:
            return fp.write(data)


class FileProvider(object):
    name = 'files'

    def __init__(self, config):
        # We don't support and configuration, so intentionally empty
        pass

    def get(self, *path):
        return Record(*path)
