예제 #1
0
파일: resource.py 프로젝트: iske/PySolFC
 def __init__(self, **kw):
     kw = KwStruct(kw,
         name = "",
         filename = "",
         basename = "",      # basename of filename
         absname = "",       # absolute filename
         # implicit
         index = -1,
         error = 0,          # error while loading this resource
     )
     Struct.__init__(self, **kw.getKw())
예제 #2
0
 def __init__(self, **kw):
     kw = KwStruct(
         kw,
         name="",
         filename="",
         basename="",  # basename of filename
         absname="",  # absolute filename
         # implicit
         index=-1,
         error=0,  # error while loading this resource
     )
     Struct.__init__(self, **kw.getKw())
예제 #3
0
 def __init__(self, parent, ex, title="Error", **kw):
     kw = KwStruct(kw, bitmap="error")
     text = kw.get("text", "")
     if not text.endswith("\n"):
         text = text + "\n"
     text = text + "\n"
     if isinstance(ex, EnvironmentError) and ex.filename is not None:
         t = "[Errno %s] %s:\n%s" % (ex.errno, ex.strerror, repr(ex.filename))
     else:
         t = str(ex)
     kw.text = text + unicode(t, errors='replace')
     MfxMessageDialog.__init__(self, parent, title, **kw.getKw())
예제 #4
0
 def __init__(self, parent, ex, title="Error", **kw):
     kw = KwStruct(kw, bitmap="error")
     text = kw.get("text", "")
     if not text.endswith("\n"):
         text = text + "\n"
     text = text + "\n"
     if isinstance(ex, EnvironmentError) and ex.filename is not None:
         t = "[Errno %s] %s:\n%s" % \
             (ex.errno, ex.strerror, repr(ex.filename))
     else:
         t = str(ex)
     kw.text = text + unicode(t, errors='replace')
     MfxMessageDialog.__init__(self, parent, title, **kw.getKw())
예제 #5
0
파일: resource.py 프로젝트: iske/PySolFC
 def __init__(self, **kw):
     # start with all fields from CardsetConfig
     config = CardsetConfig()
     kw = KwStruct(config.__dict__, **kw)
     # si is the SelectionInfo struct that will be queried by
     # the "select cardset" dialogs. It can be freely modified.
     si = Struct(type=0, size=0, styles=[], nationalities=[], dates=[])
     kw = KwStruct(kw,
         # essentials
         ranks = (),
         suits = (),
         trumps = (),
         nbottoms = 7,
         nletters = 4,
         nshadows = 1 + 13,
         # selection criterias
         si = si,
         # implicit
         backname = None,
         dir = "",
     )
     Resource.__init__(self, **kw.getKw())
예제 #6
0
 def __init__(self, **kw):
     # start with all fields from CardsetConfig
     config = CardsetConfig()
     kw = KwStruct(config.__dict__, **kw)
     # si is the SelectionInfo struct that will be queried by
     # the "select cardset" dialogs. It can be freely modified.
     si = Struct(type=0, size=0, styles=[], nationalities=[], dates=[])
     kw = KwStruct(
         kw,
         # essentials
         ranks=(),
         suits=(),
         trumps=(),
         nbottoms=7,
         nletters=4,
         nshadows=1 + 13,
         # selection criteria
         si=si,
         # implicit
         backname=None,
         dir="",
     )
     Resource.__init__(self, **kw.getKw())