Exemplo n.º 1
0
def delete(file):
  if exists(file):
    os.remove(
      io.absolute_path(file, __dirname)
    )
    return True
  return False
Exemplo n.º 2
0
def write(data, file):
  file_existed = True if exists(file) else False
  io.write_file(
    data,
    io.absolute_path(file, __dirname),
  )
  return file_existed
Exemplo n.º 3
0
def exists(file = '', isState = False):
  file = io.absolute_path(file, __dirname, isState)
  return os.path.exists(file)
Exemplo n.º 4
0
def get_state(file = 'state'):
  if exists(file, True):
    return io.readFile(io.absolute_path(file, __dirname, True))
  return False
Exemplo n.º 5
0
def set_state(data):
  return io.write_file(
    data,
    io.absolute_path('state', __dirname, True),
  )
Exemplo n.º 6
0
def read(file):
  if exists(file):
    return io.readFile(
      io.absolute_path(file, __dirname),
    )