def setUp(self):
     self.log = Log()
     self.log.verbosity=10
     self.log.cacheflag=True
     self.log.logdir=LOGDIR,
     self.log.pidlogname=False
     self.log.proclogname=False
     self.log.pad=False
   def setUp(self):        
       self.log = Log()
       self.log.pidlogname=True
       self.log.proclogname=True  
       self.log.startlog()
       #super(Test_Log_Names,self).setUp()
 
       
       @logger(self.log)
       def func1(*args,**kwargs):
           return(100)
       
       self.func1  = func1
import sys
from misc_utils_log import Log, logger
log = Log(cacheflag=True,logdir="/tmp/log",verbosity=10,
          pidlogname=True,proclogname=False)

from type_utils import SetMemberPartial, DBSetMember, TextAlphaNum, \
     TextAlphaNumRO, TrueFalse
from ui_utils import TkImageLabelGrid, geometry_get_dict, geometry_get, TkGridEntry
from misc_utils import nxnarraycreate, thisfuncname


import sswizard_utils

from database_util import Database, tbl_create
from database_table_util import dbtblgeneric, tbl_rows_get, \
     tbl_rows_update, dbtblfactory, tbl_col_update, tbl_col_add,tbl_row_delete

from collections import OrderedDict
from Tkinter import *
from ttk import *
import tkFont

class DBTableUI(Tk):
    def __init__(self,maxentrycols=18,maxentryrows=12,
                 maxnewrowcols=16,maxnewrowrows=3):
        
        Tk.__init__(self)

        self.lastsaveversion=0
        
        # any children that change update this 
Exemple #4
0
#/usr/bin/python
import os
import xml.etree.ElementTree as xmltree
import sys
from misc_utils_log import Log, logger, PRIORITY

if sys.platform == "win32":
    LOGDIR = "./"
else:
    LOGDIR = "/tmp/log"

log = Log(cacheflag=True, logdir=LOGDIR, verbosity=10)


def _getclassmethods(clsobj, inverse=False):
    ''' inverse will return anything not a class method - so a member variable'''
    from inspect import ismethod
    return ([
        key for key, obj in _getmembers(clsobj).iteritems()
        if ismethod(obj) <> inverse
    ])


def _getclasses(module, filename):
    from inspect import isclass
    from sys import modules
    from os.path import splitext, basename

    classes = [name for name in _dir(module) if isclass(getattr(module, name))]
    imported_sysclasses_remove(classes, filename)
    return classes
Exemple #5
0
    'ns3': 'http://www.garmin.com/xmlschemas/ActivityExtension/v2'
}

__version__ = '0.1'
DOWNLOAD_DIR = "C:\\Users\\burtnolej\\Downloads"
#INPUT_FILE_DIR = environ["PYTHONAPPS"] + "\\apps\\trainerroad\\tcx_files"
INPUT_FILE_DIR = "C:\\Users\\burtnolej\\Documents\\GitHub\\hungrycrayon\\apps\\traineroad\\tcx_files"

if sys.platform == "win32":
    LOGDIR = "./"
else:
    LOGDIR = "/tmp/log"

log = Log(cacheflag=False,
          logdir=LOGDIR,
          verbosity=5,
          pidlogname=True,
          proclogname=False)
log.config = OrderedDict([('now', 12), ('type', 10), ('class', 15),
                          ('funcname', 15), ('module', 20), ('msg', -1)])


class TcxParser(object):
    def __init__(self,
                 input_files_dir,
                 databasename="trainerroad",
                 tablename="trainerroad",
                 verbosity=5):
        self.files = {}
        self.input_files_dir = input_files_dir
        self.databasename = databasename
 def setUp(self):
     self.log = Log()
     self.log.config = OrderedDict([('linenum',5)]) 
     self.log.cacheflag=True
     self.log.startlog()
from os import path as ospath
from misc_utils import nxnarraycreate

from database_table_util import tbl_query, tbl_rows_update, tbl_rows_get, tbl_exists, tbl_create, tbl_rows_insert, \
     DBException, dbtblfactory, _gencoldefn, _quotestrs
from database_util import Database
from collections import OrderedDict
from misc_utils_log import Log, logger
from misc_utils import thisfuncname

from shutil import copyfile

from sswizard_query_utils import _sessionenum, _maxlessonenum, _maxsessionenum

log = Log(cacheflag=True,
          logdir="/tmp/log",
          pidlogname=False,
          proclogname=False)


def _updaterecordval(record, new_value, obj_type, cols):
    _idx = cols.index(obj_type)
    record.pop(_idx)
    record.insert(_idx, new_value)
    return (record)


def update_callback(ui, widget, new_value):
    ''' via BaseTk class; all entry widgets assign a callback to the change event
    to call this function if it exists '''

    #put event on here too
import sys
from misc_utils_log import Log, logger, PRIORITY
from os.path import basename
from os import listdir, remove
from shutil import move, copy
from collections import OrderedDict

if sys.platform == "win32":
    LOGDIR = "./"
else:
    LOGDIR = "/tmp/log"

log = Log(cacheflag=False,
          logdir=LOGDIR,
          verbosity=5,
          pidlogname=True,
          proclogname=False,
          config=OrderedDict([('now', 12), ('type', 10), ('class', 15),
                              ('funcname', 15), ('module', 20), ('msg', -1)]))


class MoveFiles(object):
    ''' subclass need to overwrite _target_conv and _source_conv for there specific filename
    convertion functions (see trainerroad implementation)'''
    def __init__(self, sourcedir, targetdir, prefix="", moveflag=False):
        self.sourcedir = sourcedir
        self.targetdir = targetdir
        self.prefix = prefix
        self.moveflag = moveflag
        log.log(PRIORITY.INFO, msg="moveflag set to [" + str(moveflag) + "]")
        log.log(PRIORITY.INFO,