Optimize imports
This commit is contained in:
parent
2e7a4ad132
commit
e588c30044
29 changed files with 730 additions and 924 deletions
|
|
@ -14,9 +14,6 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from nemubot.tools.xmlparser import module_state
|
||||
|
||||
|
||||
class Abstract:
|
||||
|
||||
"""Abstract implementation of a module data store, that always return an
|
||||
|
|
@ -38,6 +35,7 @@ class Abstract:
|
|||
The loaded data
|
||||
"""
|
||||
|
||||
from nemubot.tools.xmlparser import module_state
|
||||
return module_state.ModuleState("nemubotstate")
|
||||
|
||||
def save(self, module, data):
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
import os
|
||||
|
||||
from nemubot.datastore.abstract import Abstract
|
||||
from nemubot.tools.xmlparser import parse_file
|
||||
|
||||
|
||||
class XML(Abstract):
|
||||
|
|
@ -66,6 +65,7 @@ class XML(Abstract):
|
|||
|
||||
data_file = self._get_data_file_path(module)
|
||||
if os.path.isfile(data_file):
|
||||
from nemubot.tools.xmlparser import parse_file
|
||||
return parse_file(data_file)
|
||||
else:
|
||||
return Abstract.load(self, module)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue