missing "self"s and imports...
This commit is contained in:
@@ -819,6 +819,7 @@ Finds the installed package which contains the specified file.
|
|||||||
search_exact = staticmethod(search_exact)
|
search_exact = staticmethod(search_exact)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
import os.path
|
||||||
|
|
||||||
self.init(True)
|
self.init(True)
|
||||||
|
|
||||||
@@ -830,7 +831,7 @@ Finds the installed package which contains the specified file.
|
|||||||
for path in self.args:
|
for path in self.args:
|
||||||
ctx.ui.info(_('Searching for %s') % path)
|
ctx.ui.info(_('Searching for %s') % path)
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
search_exact(os.path.realpath(path))
|
self.search_exact(os.path.realpath(path))
|
||||||
else:
|
else:
|
||||||
pisi.api.error(_('%s cannot be found'))
|
pisi.api.error(_('%s cannot be found'))
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -103,14 +103,14 @@ class FilesDB(shelve.LockedDBShelf):
|
|||||||
shelve.LockedDBShelf.__init__(self, 'files')
|
shelve.LockedDBShelf.__init__(self, 'files')
|
||||||
#self.files_dir = pisi.util.join_path(ctx.config.db_dir(), 'files')
|
#self.files_dir = pisi.util.join_path(ctx.config.db_dir(), 'files')
|
||||||
|
|
||||||
def add_files(pkg_name, files):
|
def add_files(self, pkg_name, files):
|
||||||
for x in files.list:
|
for x in files.list:
|
||||||
self[x.path] = (pkg_name, x)
|
self[x.path] = (pkg_name, x)
|
||||||
|
|
||||||
def has_file(path):
|
def has_file(self, path):
|
||||||
return self.has_key(path)
|
return self.has_key(path)
|
||||||
|
|
||||||
def get_file_info(path):
|
def get_file_info(self, path):
|
||||||
if not self.has_key(path):
|
if not self.has_key(path):
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user