~ubuntu-branches/ubuntu/trusty/click/trusty-proposed

« back to all changes in this revision

Viewing changes to click/commands/info.py

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Colin Watson
  • Date: 2014-03-06 16:38:35 UTC
  • Revision ID: package-import@ubuntu.com-20140306163835-1ugtgqym7j404cbi
Tags: 0.4.17.2
[ Colin Watson ]
Fix Click.User construction in "click pkgdir".

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
import os
25
25
import sys
26
26
 
27
 
from click.database import ClickDB
 
27
from gi.repository import Click
 
28
 
28
29
from click.install import DebFile
29
 
from click.user import ClickUser
30
30
 
31
31
 
32
32
def get_manifest(options, arg):
33
33
    if "/" not in arg:
34
 
        db = ClickDB(options.root)
35
 
        registry = ClickUser(db, user=options.user)
36
 
        if arg in registry:
 
34
        db = Click.DB()
 
35
        db.read()
 
36
        if options.root is not None:
 
37
            db.add(options.root)
 
38
        registry = Click.User.for_user(db, name=options.user)
 
39
        if registry.has_package_name(arg):
37
40
            manifest_path = os.path.join(
38
 
                registry.path(arg), ".click", "info", "%s.manifest" % arg)
 
41
                registry.get_path(arg), ".click", "info", "%s.manifest" % arg)
39
42
            with io.open(manifest_path, encoding="UTF-8") as manifest:
40
43
                return json.load(manifest)
41
44