File: sugar-install-bundle

package info (click to toggle)
sugar 0.121-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,256 kB
  • sloc: python: 28,842; sh: 955; xml: 510; makefile: 379
file content (28 lines) | stat: -rwxr-xr-x 649 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/env python3
import os
import sys

from sugar3.bundle.activitybundle import ActivityBundle

from dbus.mainloop.glib import DBusGMainLoop
DBusGMainLoop(set_as_default=True)


def cmd_help():
    print('Usage: sugar-install-bundle activitybundle.xo [...] \n\n\
    Install activity bundles\n')


if len(sys.argv) < 2:
    cmd_help()
    sys.exit(2)

for name in sys.argv[1:]:
    bundle = ActivityBundle(name)
    path = bundle.install()

    # make sure that the BundleRegistry will add this bundle
    # by triggering a GFileMonitor ATTRIBUTE_CHANGED event.
    os.utime(path, None)

    print("%s: '%s' installed." % (sys.argv[0], name))