# Path: core/config.py
# PLATFORM_NAME = "kodi-isengard"
# PLUGIN_NAME = "streamondemand-pureita-master"
# def get_platform():
# def is_xbmc():
# def get_library_support():
# def get_system_platform():
# def open_settings():
# def get_setting(name):
# def set_setting(name,value):
# def get_localized_string(code):
# def get_library_path():
# def get_temp_file(filename):
# def get_runtime_path():
# def get_data_path():
# def get_cookie_data():
# def verify_directories_created():
# 
# Path: core/logger.py
# def log_enable(active):
# def encode_log(message=""):
# def get_caller(message=None):
# def info(texto=""):
# def debug(texto=""):
# def error(texto=""):


import os
import sys
    import re
  import re
  import socket
        import random
          import xbmc
from core import config
from core import logger
from smb.SMBConnection import SMBConnection
from nmb.NetBIOS import NetBIOS
    logger.info("Url: %s" % url)
    remote, share_name, path = connect(url)
    try:
      files = [f.filename for f in remote.listPath(share_name, os.path.dirname(path)) if not f.isDirectory]
    except Exception, e:
      raise type(e)(e.message,"")
    return os.path.basename(path) in files
    

def isdir(url):
    logger.info("Url: %s" % url)
    remote, share_name, path = connect(url)
    try:
      folders = [f.filename for f in remote.listPath(share_name, os.path.dirname(path)) if f.isDirectory]
    except Exception, e:
      raise type(e)(e.message,"")
    return os.path.basename(path) in folders or path == "/"


def exists(url):
    logger.info("Url: %s" % url)
    remote, share_name, path = connect(url)
    try:
      files = [f.filename for f in remote.listPath(share_name, os.path.dirname(path))]
    except Exception, e:
      raise type(e)(e.message,"")
    return os.path.basename(path) in files or path == "/"
    
    
def remove(url):

# Path: core/config.py
# PLATFORM_NAME = "kodi-isengard"
# PLUGIN_NAME = "streamondemand-pureita-master"
# def get_platform():
# def is_xbmc():
# def get_library_support():
# def get_system_platform():
# def open_settings():
# def get_setting(name):
# def set_setting(name,value):
# def get_localized_string(code):
# def get_library_path():
# def get_temp_file(filename):
# def get_runtime_path():
# def get_data_path():
# def get_cookie_data():
# def verify_directories_created():
# 
# Path: core/logger.py
# def log_enable(active):
# def encode_log(message=""):
# def get_caller(message=None):
# def info(texto=""):
# def debug(texto=""):
# def error(texto=""):


# Path: lib/sambatools/libsmb.py
import os
import sys
    import re
  import re
  import socket
        import random
          import xbmc
from core import config
from core import logger
from smb.SMBConnection import SMBConnection
from nmb.NetBIOS import NetBIOS

    logger.info("Url: %s" % url)
    remote, share_name, path = connect(url)
    try:
      files = [f.filename for f in remote.listPath(share_name, os.path.dirname(path)) if not f.isDirectory]
    except Exception, e:
      raise type(e)(e.message,"")
    return os.path.basename(path) in files
    

def isdir(url):
    logger.info("Url: %s" % url)
    remote, share_name, path = connect(url)
    try:
      folders = [f.filename for f in remote.listPath(share_name, os.path.dirname(path)) if f.isDirectory]
    except Exception, e:
      raise type(e)(e.message,"")
    return os.path.basename(path) in folders or path == "/"


def exists(url):
    logger.info("Url: %s" % url)
    remote, share_name, path = connect(url)
    try:
      files = [f.filename for f in remote.listPath(share_name, os.path.dirname(path))]
    except Exception, e:
      raise type(e)(e.message,"")
    return os.path.basename(path) in files or path == "/"
    
    
def remove(url):

    logger.info("Url: %s" % url)