Commits

Chris Mutel  committed 94c63bc

Small fixes

  • Participants
  • Parent commits 6ed6c78

Comments (0)

Files changed (3)

File brightway2/database.py

-# -*- coding: utf-8 -*
+# -*- coding: utf-8 -*-
 from . import databases, config, mapping
 from errors import MissingIntermediateData, UnknownObject
 import os
 except ImportError:
     import pickle
 
+# TODO: def backup
+# TODO: def revert
+
 
 class Database(object):
     """A manager for a database. This class can register or deregister databases, write intermediate data, process data to parameter arrays, query, validate, and copy databases.

File brightway2/method.py

-# -*- coding: utf-8 -*
+# -*- coding: utf-8 -*-
 from . import config, mapping, methods
 from copy import copy
 from errors import UnknownObject, MissingIntermediateData
-from utils import MAX_INT_32
+from utils import MAX_INT_32, random_string
 import numpy as np
 import os
-import random
 import string
 from validate import ia_validator
 try:
     abbrev = lambda x: x if x[0] in string.digits else x[0].lower()
     name = " ".join(names).split(" ")[0].lower() + \
         "".join([abbrev(x) for x in " ".join(names).split(" ")[1:]])
-    random_string = ''.join(random.choice(string.letters + string.digits
-        ) for i in xrange(length))
-    return name + "-" + random_string
+    return name + "-" + random_string(length)
 
 
 class Method(object):
   author="Chris Mutel",
   author_email="cmutel@gmail.com",
   license=open('LICENSE.txt').read(),
-  requires=["voluptuous", "nose", "progressbar", "numpy"],
+  requires=["voluptuous", "nose", "progressbar", "numpy", "lxml"],
   url="https://bitbucket.org/cmutel/brightway2",
-  long_description=open('README.txt').read(),
+  long_description=open('README').read(),
 )