Global replace of Nicira Networks.
[sliver-openvswitch.git] / ovsdb / ovsdbmonitor / OVEStandard.py
1 # Copyright (c) 2011 Nicira, Inc.
2 # Copyright (c) 2010 Citrix Systems, Inc.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at:
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 import os, re, struct, sys, time, types, uuid
17 from copy import deepcopy
18 from pprint import pprint
19
20 # Set globalForcePySide to True to use PySide instead of PyQt if both are installed
21 globalForcePySide = False
22
23 try:
24     import ovs.json
25 except Exception, e:
26     print('+++ OVS JSON module is required\n')
27     raise
28
29 try:
30     if globalForcePySide:
31         print('Forcing use of PySide')
32         raise Exception()
33     from PyQt4.QtCore import Qt, QVariant
34     from PyQt4 import QtCore, QtGui
35 except:
36     try:
37         from PySide.QtCore import Qt, QVariant
38         from PySide import QtCore, QtGui
39     except Exception, e:
40         print('+++ This application requires either PyQt4 or PySide\n')
41         raise
42