1
2 """
3
4 @author: Fabio Erculiani <lxnay@sabayonlinux.org>
5 @contact: lxnay@sabayonlinux.org
6 @copyright: Fabio Erculiani
7 @license: GPL-2
8
9 B{Entropy Package Manager Client EntropyRepository plugin code}.
10
11 """
12 from entropy.const import const_debug_write
13 from entropy.db.skel import EntropyRepositoryPlugin
14
16
17 - def __init__(self, client_interface, metadata = None):
18 """
19 Entropy client-side repository EntropyRepository Plugin class.
20 This class will be instantiated and automatically added to
21 EntropyRepository instances generated by Entropy Client.
22
23 @param client_interface: Entropy Client interface instance
24 @type client_interface: entropy.client.interfaces.Client class
25 @param metadata: any dict form metadata map (key => value)
26 @type metadata: dict
27 """
28 EntropyRepositoryPlugin.__init__(self)
29 self._client = client_interface
30 if metadata is None:
31 self._metadata = {}
32 else:
33 self._metadata = metadata
34
35
36
37
38
39 self._metadata['client_repo'] = True
40
43
46
48 const_debug_write(__name__,
49 "ClientEntropyRepositoryPlugin: calling add_plugin_hook => %s" % (
50 self,)
51 )
52
53 out_intf = self._metadata.get('output_interface')
54 if out_intf is not None:
55 entropy_repository_instance.updateProgress = out_intf.updateProgress
56 entropy_repository_instance.askQuestion = out_intf.askQuestion
57
58 return 0
59