# 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):


from wh import xlt, AcceleratorHelper, Menu, Grid, evalAsPython, localTimeMillis
from _pgsql import pgQuery, pgConnectionPool, quoteValue, quoteIdent
from _sqlgrid import SqlFrame, EditTable, HMARGIN, VMARGIN
from _sqledit import SqlEditor
from Table import Table
import wx.aui
import wx.grid
import adm
import logger
    self.OnFilterCheck()
    self.valid=True
    self.dialog=dlg
    self.EnableControls("FilterPreset", dlg.querypreset_table)
    self.EnableControls("FilterSave", False)

  def AddExtraControls(self, res):
    self.FilterValue=SqlEditor(self)
    res.AttachUnknownControl("FilterValuePlaceholder", self.FilterValue)
    self.FilterValue.SetMarginWidth(1, 0)

  def OnPresetSelect(self, evt):
    preset=self.FilterPreset.strip()
    if not preset:
      return
    query=pgQuery(self.dialog.querypreset_table, self.dialog.server.GetCursor())
    query.AddCol('querylimit')
    query.AddCol('filter')
    query.AddCol('sort')
    query.AddCol('display')
    query.AddCol('sql')
    query.AddWhere('dbname', self.tableSpecs.dbName)
    query.AddWhere('tabname', self.tableSpecs.tabName)
    query.AddWhere('presetname', preset)
    
    res=query.Select()
    for row in res:
      limit=row['querylimit']
      filter=row['filter']
      sort=evalAsPython(row['sort'])

# 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/DataTool.py
from wh import xlt, AcceleratorHelper, Menu, Grid, evalAsPython, localTimeMillis
from _pgsql import pgQuery, pgConnectionPool, quoteValue, quoteIdent
from _sqlgrid import SqlFrame, EditTable, HMARGIN, VMARGIN
from _sqledit import SqlEditor
from Table import Table
import wx.aui
import wx.grid
import adm
import logger

    self.OnFilterCheck()
    self.valid=True
    self.dialog=dlg
    self.EnableControls("FilterPreset", dlg.querypreset_table)
    self.EnableControls("FilterSave", False)

  def AddExtraControls(self, res):
    self.FilterValue=SqlEditor(self)
    res.AttachUnknownControl("FilterValuePlaceholder", self.FilterValue)
    self.FilterValue.SetMarginWidth(1, 0)

  def OnPresetSelect(self, evt):
    preset=self.FilterPreset.strip()
    if not preset:
      return
    query=pgQuery(self.dialog.querypreset_table, self.dialog.server.GetCursor())
    query.AddCol('querylimit')
    query.AddCol('filter')
    query.AddCol('sort')
    query.AddCol('display')
    query.AddCol('sql')
    query.AddWhere('dbname', self.tableSpecs.dbName)
    query.AddWhere('tabname', self.tableSpecs.tabName)
    query.AddWhere('presetname', preset)
    
    res=query.Select()
    for row in res:
      limit=row['querylimit']
      filter=row['filter']
      sort=evalAsPython(row['sort'])

      display=evalAsPython(row['display'])