# Path: wh.py
# def SetLoaddir(d):
#   def __init__(self, frame):
#   def Add(self, flags, keycode, cmd):
#   def GetTable(self):
#   def Realize(self):
#   def __init__(self, parent):
#   def OnLabelLeftClick(self, evt):
#   def GetAllSelectedRows(self):
#   def quoteVal(self, val, quoteChar):
#   def GetAllSelectedCellValues(self, withLabel=True):
#   def __init__(self, frame, size=32, style=wx.TB_FLAT|wx.TB_NODIVIDER):
#   def Enable(self, procOrId, how=None):
#   def AddCheck(self, procOrCls, text=None, bitmap=None):
#   def Add(self, procOrCls, text=None, bitmap=None, kind=wx.ITEM_NORMAL):
#   def __init__(self, frame, config=None):
#   def _currentDirectory(self):
#   def _makePatterns(self, filePatterns):
#   def _saveFile(self, wnd, contents, filePatterns, message, filename):
#   def OpenFile(self, wnd, filePatterns, message=None, filename=None):
#   def SaveFile(self, wnd, content, filePatterns, message=None):
#   def SaveFileAs(self, wnd, content, filePatterns, message=None):
#   def OnSelectFile(self, evt):
#   def GetRecentFilesMenu(self):
#   def _handleMenu(self):
#   def _handleConfig(self):
# def localizePath(path):
# def modPath(name, mod):
# def evalAsPython(val, default=None):
# def GetIcon(name, module=None):
# def GetBitmap(name, module=None):
#   def __init__(self, wnd, proc):
#   def __init__(self, menuOwner=None):
#   def Popup(self, evt):
#   def getId(self, something):
#   def Enable(self, something, how):
#   def IsEnabled(self, something):
#   def Check(self, something, how):
#   def IsChecked(self, something):
#   def Add(self, onproc, name, desc=None, id=-1, macproc=None):
#   def AddCheck(self, onproc, name, desc, how=True):
#   def AppendOneMenu(self, menu, txt, help=None):
#   def Dup(self):
#   def getRepr(self, m, indentstr):
#   def __str__(self):
# def YesNo(b):
# def xlt(s): # translate
# def removeSmartQuote(txt):
# def quoteIfNeeded(txt, quoteChar='"'):
# def shlexSplit(str, sep):
# def copytree(src, dst, symlinks=False, ignore=None, replace=True):
#   def __init__(self, str=None):
#   def setString(self, items):
#   def getList(self):
#   def getString(self):
# def restoreSize(unused_name, unused_defSize=None, unused_defPos=None):
# def breakLines(text, breakLen=80):
# def splitValUnit(value):
# def strToIsoDate(val):
# def utc2local(value):
# def isoDateToStr(value):
# def timeToFloat(value):
# def floatToTime(value, nk=1):
# def prettyTime(val, nk=1):
# def prettyDate(val, long=True):
# def sizeToFloat(value):
# def prettySize(val):
# def floatToSize(val, resolution=0):
# class AcceleratorHelper:
# class Grid(wx.grid.Grid):
# class ToolBar(wx.ToolBar):
# class FileManager:
# class Timer(wx.Timer):
# class Menu(wx.Menu):
# class ParamDict(dict):


import adm
import wx.grid, wx.aui
from wh import xlt, ToolBar, floatToTime, localTimeMillis
from _pgsql import pgQuery, quoteIdent, quoteValue
  def OnCut(self, evt):
    wnd=wx.Window.FindFocus()
    if wnd:
      wnd.Cut()
  
  def OnCopy(self, evt):
    wnd=wx.Window.FindFocus()
    if wnd:
      wnd.Copy()
  
  def OnPaste(self, evt):
    wnd=wx.Window.FindFocus()
    if wnd:
      wnd.Paste()

  def pollWorker(self):
    while self.worker.IsRunning():
      elapsed=localTimeMillis() - self.startTime
      self.SetStatusText(floatToTime(elapsed/1000.), self.STATUSPOS_SECS)
      wx.Yield()
      if elapsed < 200:
        wx.MilliSleep(10);
      elif elapsed < 10000:
        wx.MilliSleep(100);
      else:
        wx.MilliSleep(500)
      wx.Yield()
    
    elapsed=localTimeMillis() - self.startTime
    if elapsed:

# Path: wh.py
# def SetLoaddir(d):
#   def __init__(self, frame):
#   def Add(self, flags, keycode, cmd):
#   def GetTable(self):
#   def Realize(self):
#   def __init__(self, parent):
#   def OnLabelLeftClick(self, evt):
#   def GetAllSelectedRows(self):
#   def quoteVal(self, val, quoteChar):
#   def GetAllSelectedCellValues(self, withLabel=True):
#   def __init__(self, frame, size=32, style=wx.TB_FLAT|wx.TB_NODIVIDER):
#   def Enable(self, procOrId, how=None):
#   def AddCheck(self, procOrCls, text=None, bitmap=None):
#   def Add(self, procOrCls, text=None, bitmap=None, kind=wx.ITEM_NORMAL):
#   def __init__(self, frame, config=None):
#   def _currentDirectory(self):
#   def _makePatterns(self, filePatterns):
#   def _saveFile(self, wnd, contents, filePatterns, message, filename):
#   def OpenFile(self, wnd, filePatterns, message=None, filename=None):
#   def SaveFile(self, wnd, content, filePatterns, message=None):
#   def SaveFileAs(self, wnd, content, filePatterns, message=None):
#   def OnSelectFile(self, evt):
#   def GetRecentFilesMenu(self):
#   def _handleMenu(self):
#   def _handleConfig(self):
# def localizePath(path):
# def modPath(name, mod):
# def evalAsPython(val, default=None):
# def GetIcon(name, module=None):
# def GetBitmap(name, module=None):
#   def __init__(self, wnd, proc):
#   def __init__(self, menuOwner=None):
#   def Popup(self, evt):
#   def getId(self, something):
#   def Enable(self, something, how):
#   def IsEnabled(self, something):
#   def Check(self, something, how):
#   def IsChecked(self, something):
#   def Add(self, onproc, name, desc=None, id=-1, macproc=None):
#   def AddCheck(self, onproc, name, desc, how=True):
#   def AppendOneMenu(self, menu, txt, help=None):
#   def Dup(self):
#   def getRepr(self, m, indentstr):
#   def __str__(self):
# def YesNo(b):
# def xlt(s): # translate
# def removeSmartQuote(txt):
# def quoteIfNeeded(txt, quoteChar='"'):
# def shlexSplit(str, sep):
# def copytree(src, dst, symlinks=False, ignore=None, replace=True):
#   def __init__(self, str=None):
#   def setString(self, items):
#   def getList(self):
#   def getString(self):
# def restoreSize(unused_name, unused_defSize=None, unused_defPos=None):
# def breakLines(text, breakLen=80):
# def splitValUnit(value):
# def strToIsoDate(val):
# def utc2local(value):
# def isoDateToStr(value):
# def timeToFloat(value):
# def floatToTime(value, nk=1):
# def prettyTime(val, nk=1):
# def prettyDate(val, long=True):
# def sizeToFloat(value):
# def prettySize(val):
# def floatToSize(val, resolution=0):
# class AcceleratorHelper:
# class Grid(wx.grid.Grid):
# class ToolBar(wx.ToolBar):
# class FileManager:
# class Timer(wx.Timer):
# class Menu(wx.Menu):
# class ParamDict(dict):


# Path: modPg/_sqlgrid.py
import adm
import wx.grid, wx.aui
from wh import xlt, ToolBar, floatToTime, localTimeMillis
from _pgsql import pgQuery, quoteIdent, quoteValue

  def OnCut(self, evt):
    wnd=wx.Window.FindFocus()
    if wnd:
      wnd.Cut()
  
  def OnCopy(self, evt):
    wnd=wx.Window.FindFocus()
    if wnd:
      wnd.Copy()
  
  def OnPaste(self, evt):
    wnd=wx.Window.FindFocus()
    if wnd:
      wnd.Paste()

  def pollWorker(self):
    while self.worker.IsRunning():
      elapsed=localTimeMillis() - self.startTime
      self.SetStatusText(floatToTime(elapsed/1000.), self.STATUSPOS_SECS)
      wx.Yield()
      if elapsed < 200:
        wx.MilliSleep(10);
      elif elapsed < 10000:
        wx.MilliSleep(100);
      else:
        wx.MilliSleep(500)
      wx.Yield()
    
    elapsed=localTimeMillis() - self.startTime
    if elapsed:

      txt=floatToTime(elapsed/1000.)