I try to import configparser, but it i found an error.
I tried to fix it, but I can't find the error.
MyCode:
Code: Select all
# =============================================================================
# >> IMPORTS
# =============================================================================
# Reads configs or cfg files
import ConfigParser
# =============================================================================
# >> CLASSES
# =============================================================================
class inicfg(object):
def __init__(self, path, file):
self.__filepath = str(path) + str(file)
self.__path = path
self.__file = file
config = ConfigParser.RawConfigParser()
def addSection(self, section):
config.add_section(section)
def setKeyvalue(self, section, key, value):
config.set(section, key, value)
def save(self):
with open(self.__filepath, 'wb') as configfile:
config.write(configfile)
Error:
Code: Select all
[SP] Caught an Exception:
Traceback (most recent call last):
File '..\addons\source-python\packages\source-python\addons\manager.py', line
48, in __missing__
instance = _LoadedAddon(addon_name)
File '..\addons\source-python\packages\source-python\addons\manager.py', line
237, in __init__
self._addon = __import__(addon_name + '.' + addon_name)
File '..\addons\source-python\plugins\premium\premium.py', line 26, in <module
>
from premium._libs import inicfg
ImportError: cannot import name inicfg
[SP] Addon 'premium' was unable to be loaded.