openknowledge-archive / dpm-old

**DEPRECATED** - see https://github.com/frictionlessdata/. [[Data package manager (dpm) is a command line tool and Python library for working with data packages - http://data.okfn.org/standards/data-package/]]
http://dpm.readthedocs.org/
15 stars 8 forks source link

restrict dpm.lib.save() for already inited packages. #39

Closed dgraziotin closed 12 years ago

dgraziotin commented 12 years ago

I gave too much freedom with the current version of save. Therefore, I restrict the function as follows:

lib.save(package)
   try to also get the package from package.installed_path
   if there is a package there, then
      save the package.
   else
      throw an exception

In this way, we ensure that either the package was inited before or there is another package on that installed_path. In the second case, the package will be overwritten. By deleting the path parameter and adding the check, we no more let users create non-inited packages from this function.

dgraziotin commented 12 years ago

Fixed in pull request #41