Correct stray use of location
[mudpy.git] / lib / mudpy / data.py
index de76416..ad171d8 100644 (file)
@@ -1,10 +1,19 @@
 # -*- coding: utf-8 -*-
 """Data interface functions for the mudpy engine."""
 
-# Copyright (c) 2004-2013 Jeremy Stanley <fungi@yuggoth.org>. Permission
+# Copyright (c) 2004-2014 Jeremy Stanley <fungi@yuggoth.org>. Permission
 # to use, copy, modify, and distribute this software is granted under
 # terms provided in the LICENSE file distributed with this software.
 
+import codecs
+import configparser
+import os
+import re
+import stat
+import sys
+
+import mudpy
+
 
 class DataFile:
 
@@ -17,14 +26,6 @@ class DataFile:
 
     def load(self):
         """Read a file and create elements accordingly."""
-        import mudpy.misc
-        import os
-        import os.path
-        # TODO: remove this check after the switch to py3k
-        try:
-            import configparser
-        except ImportError:
-            import ConfigParser as configparser
         self.data = configparser.RawConfigParser()
         self.modified = False
         if os.access(self.filename, os.R_OK):
@@ -101,11 +102,6 @@ class DataFile:
 
     def save(self):
         """Write the data, if necessary."""
-        import codecs
-        import os
-        import os.path
-        import re
-        import stat
 
         # when modified, writeable and has content or the file exists
         if self.modified and self.is_writeable() and (
@@ -197,9 +193,6 @@ def find_file(
     universe=None
 ):
     """Return an absolute file path based on configuration."""
-    import os
-    import os.path
-    import sys
 
     # make sure to get rid of any surrounding quotes first thing
     if file_name: