-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdryrun.py
executable file
·49 lines (36 loc) · 1.45 KB
/
dryrun.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
import libchannels.channel
import libchannels.discovery
import libchannels.resolver
from libchannels.actions import ActionType
discovery = libchannels.discovery.ChannelDiscovery()
discovery.discover()
if (not "semplice-devel" in discovery.channels):
discovery.cache["semplice-devel"].enable()
print(discovery.channels)
resolver = libchannels.resolver.DependencyResolver(discovery.cache)
print(resolver.relations)
print(resolver.relations["semplice-jessie"][0])
if resolver.relations["semplice-jessie"][0]:
print("NO")
else:
print("YE")
print("semplice-current", not (False in resolver.relations["semplice-current"]))
print(resolver.is_channel_enableable("semplice-jessie"))
print("semplice-current enabled: %s" % discovery.cache["semplice-current"].enabled)
# Print blockers for some channels
for channel in ["semplice-current", "semplice-jessie"]:
print("%s blockers: %s" % (channel, resolver.get_channel_blockers(channel)))
print("%s solution: %s" % (channel, resolver.get_channel_solution(channel, ActionType.ENABLE)))
print("%s blockers: %s" % ("sid", resolver.get_channel_blockers("sid", ActionType.DISABLE)))
print("%s solution: %s" % ("sid", resolver.get_channel_solution("sid", ActionType.DISABLE)))
sys.exit(0)
# Disable sample
if ("sample" in discovery.channels):
print("Disabling sample")
discovery.channels["sample"].disable()
else:
print("Enabling sample")
discovery.cache["sample"].enable()