/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos-ctl

  • Committer: Teddy Hogeborn
  • Date: 2012-05-06 16:13:00 UTC
  • Revision ID: teddy@recompile.se-20120506161300-43rls2rr4qub3zhw
* mandos: Use a class decorator instead of a metaclass to provide
          alternate D-Bus interface names on D-Bus object attributes.
  (alternate_dbus_interfaces): New class decorator.
  (AlternateDBusNamesMetaclass, ClientDBusTransitional,
   MandosDBusServiceTransitional): Removed; all users changed.
  (ClientDbus, MandosDBusService): Use new "alternate_dbus_interfaces"
                                   class decorator.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#     GNU General Public License for more details.
18
18
19
19
# You should have received a copy of the GNU General Public License
20
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
20
# along with this program.  If not, see
 
21
# <http://www.gnu.org/licenses/>.
21
22
22
23
# Contact the authors at <mandos@recompile.se>.
23
24
116
117
        if type(value) is dbus.Boolean:
117
118
            return "Yes" if value else "No"
118
119
        if keyword in ("Timeout", "Interval", "ApprovalDelay",
119
 
                       "ApprovalDuration"):
 
120
                       "ApprovalDuration", "ExtendedTimeout"):
120
121
            return milliseconds_to_string(value)
121
122
        return unicode(value)
122
123
    
207
208
    parser.add_argument("client", nargs="*", help="Client name")
208
209
    options = parser.parse_args()
209
210
    
210
 
    if has_actions(options) and not options.client and not options.all:
 
211
    if has_actions(options) and not (options.client or options.all):
211
212
        parser.error("Options require clients names or --all.")
212
213
    if options.verbose and has_actions(options):
213
214
        parser.error("--verbose can only be used alone or with"