|
Revision 2, 1.4 kB
(checked in by edsuom, 1 year ago)
|
Import of trunk from old repo
|
| Line | |
|---|
| 1 |
# AsynCluster |
|---|
| 2 |
# A cluster management server based on Twisted's Perspective Broker and a Node |
|---|
| 3 |
# Display Manager (NDM) client. The server dispatches cluster jobs and |
|---|
| 4 |
# regulates when and how much each user can use his account on any of the |
|---|
| 5 |
# cluster node workstations. |
|---|
| 6 |
# |
|---|
| 7 |
# Copyright (C) 2006-2007 by Edwin A. Suominen, http://www.eepatents.com |
|---|
| 8 |
# |
|---|
| 9 |
# This program is free software; you can redistribute it and/or modify it under |
|---|
| 10 |
# the terms of the GNU General Public License as published by the Free Software |
|---|
| 11 |
# Foundation; either version 2 of the License, or (at your option) any later |
|---|
| 12 |
# version. |
|---|
| 13 |
# |
|---|
| 14 |
# This program is distributed in the hope that it will be useful, but WITHOUT |
|---|
| 15 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|---|
| 16 |
# FOR A PARTICULAR PURPOSE. See the file COPYING for more details. |
|---|
| 17 |
# |
|---|
| 18 |
# You should have received a copy of the GNU General Public License along with |
|---|
| 19 |
# this program; if not, write to the Free Software Foundation, Inc., 51 |
|---|
| 20 |
# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|---|
| 21 |
|
|---|
| 22 |
""" |
|---|
| 23 |
Utility functions |
|---|
| 24 |
""" |
|---|
| 25 |
|
|---|
| 26 |
VERBOSE = True |
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
def log(msg): |
|---|
| 30 |
""" |
|---|
| 31 |
Logs to stdout, if in verbose mode. |
|---|
| 32 |
""" |
|---|
| 33 |
if VERBOSE: |
|---|
| 34 |
msgProto = "\n%s\n%s\n" |
|---|
| 35 |
dashes = "-" * 40 |
|---|
| 36 |
print msgProto % (dashes, msg) |
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
def biggerFont(widget, scale): |
|---|
| 40 |
font = widget.font() |
|---|
| 41 |
font.setPointSizeF(scale * font.pointSizeF()) |
|---|
| 42 |
widget.setFont(font) |
|---|