Home | History | Annotate | Download | only in test-scripts
      1 #!/usr/bin/python
      2 
      3 import sys, dbus, flimflam
      4 
      5 flim = flimflam.FlimFlam(dbus.SystemBus())
      6 
      7 if len(sys.argv) == 2 and sys.argv[1] == '--list':
      8     print "[%s]" % flim.ListDebugTags()
      9 else:
     10     taglist = flim.GetDebugTags()
     11     if len(sys.argv) < 2:
     12         if taglist:
     13             print "[%s]" % taglist
     14         else:
     15             print "No debug tags are enabled"
     16     else:
     17         if sys.argv[1].startswith("+"):
     18             newtaglist = taglist
     19             if newtaglist:
     20                 newtaglist += sys.argv[1]
     21             else:
     22                 newtaglist = sys.argv[1].lstrip("+")
     23         elif sys.argv[1].startswith("-"):
     24             curr_tagset = set(taglist.split("+"))
     25             tagset_to_remove = set(sys.argv[1].lstrip("-").split("+"))
     26             newtaglist = "+".join(curr_tagset - tagset_to_remove)
     27         else:
     28             newtaglist = sys.argv[1]
     29         flim.SetDebugTags(newtaglist)
     30         print "tag list was [%s], now is [%s]" % (taglist, flim.GetDebugTags())
     31