Beispiel #1
0
 def show_(self):
     self.ui = Ui_Main()
     self.ui.setupUi(self)
     mainPath = os.path.join(util.getBaseDir(), 'httpdocs', 'main.html')
     mainUrl = QtCore.QUrl.fromLocalFile(mainPath)
     self.ui.webView.load(mainUrl)
     self.ui.webView.url = mainUrl
     self.show()
     self.setWindowState(QtCore.Qt.WindowMaximized)
     self.setWindowTitle('AssetJet {0}'.format(__version__))
Beispiel #2
0
 def show_(self):        
     self.ui = Ui_Main()
     self.ui.setupUi(self)
     mainPath = os.path.join(util.getBaseDir(), 'httpdocs', 'main.html')
     mainUrl = QtCore.QUrl.fromLocalFile(mainPath)
     self.ui.webView.load(mainUrl)
     self.ui.webView.url = mainUrl
     self.show()
     self.setWindowState(QtCore.Qt.WindowMaximized)
     self.setWindowTitle('AssetJet {0}'.format(__version__))
Beispiel #3
0
def getLogFileName(logLevel):
    return os.path.join(util.getBaseDir(), pardir, pardir, __logDir,
                        __logFile + '.' + logLevel + '.log.txt')
Beispiel #4
0
"""

import logging, logging.handlers, os
from assetjet.util import util
from os.path import pardir

__logDir = 'logfiles'
__logFile = 'assetjet'


def getLogFileName(logLevel):
    return os.path.join(util.getBaseDir(), pardir, pardir, __logDir,
                        __logFile + '.' + logLevel + '.log.txt')


if not (os.path.isdir(os.path.join(util.getBaseDir(), pardir, pardir,
                                   __logDir))):
    os.mkdir(os.path.join(util.getBaseDir(), pardir, pardir, __logDir))

# create ____loggerwith 'spam_application'
__logger = logging.getLogger('')
__logger.setLevel(logging.DEBUG)

# create file handler whi__ch logs only error messages
__fh = logging.FileHandler(getLogFileName(logLevel='error'))
__fh.setLevel(logging.ERROR)

# create file handler whi__ch logs even debug messages
__dbg = logging.FileHandler(getLogFileName('debug'))
__dbg.setLevel(logging.DEBUG)
Beispiel #5
0
def getLogFileName(logLevel):
    return os.path.join(util.getBaseDir(), pardir, pardir, __logDir, __logFile + '.' + logLevel + '.log.txt')
Beispiel #6
0
Created on Wed Dec 19 20:17:40 2012

@author: Mel
"""

import logging, logging.handlers, os
from assetjet.util import util
from os.path import pardir

__logDir = 'logfiles'
__logFile = 'assetjet'

def getLogFileName(logLevel):
    return os.path.join(util.getBaseDir(), pardir, pardir, __logDir, __logFile + '.' + logLevel + '.log.txt')

if not (os.path.isdir(os.path.join(util.getBaseDir(), pardir, pardir, __logDir))):
    os.mkdir(os.path.join(util.getBaseDir(), pardir, pardir, __logDir))

# create ____loggerwith 'spam_application'
__logger= logging.getLogger('')
__logger.setLevel(logging.DEBUG)

# create file handler whi__ch logs only error messages
__fh = logging.FileHandler(getLogFileName(logLevel='error'))
__fh.setLevel(logging.ERROR)

# create file handler whi__ch logs even debug messages
__dbg = logging.FileHandler(getLogFileName('debug'))
__dbg.setLevel(logging.DEBUG)

# create console handler 
Beispiel #7
0
import ConfigParser, os
from assetjet.util import util
import sys
from os.path import pardir

# appName will be AssetJet or AssetJetDev
appName = os.path.splitext(os.path.split(sys.executable)[1])[0]

# set name and location of config file
fileName = 'app.cfg'
location = os.path.abspath(os.path.join(util.getBaseDir(), pardir, pardir))
filePath = os.path.abspath(os.path.join(location, fileName))
#print location
#print filePath

# If config file doesn't exist, create with defaults
if not os.path.exists(os.path.join(location, fileName)):
    config = ConfigParser.RawConfigParser()
    config.add_section('Updates')
    if appName == 'AssetJet':
        config.set('Updates', 'url', r'http://www.assetjet.com/prod/downloads')
    elif appName == 'AssetJetDev':
        config.set('Updates', 'url', r'http://www.assetjet.com/dev/downloads')
    else:  # when running from source
        config.set('Updates', 'url', r'http://localhost:8000')

    with open(os.path.join(location, fileName), 'w') as configfile:
        config.write(configfile)


class Cfg(ConfigParser.ConfigParser):
Beispiel #8
0
import ConfigParser, os
from assetjet.util import util
import sys
from os.path import pardir

# appName will be AssetJet or AssetJetDev
appName = os.path.splitext(os.path.split(sys.executable)[1])[0]

# set name and location of config file
fileName = 'app.cfg'
location = os.path.abspath(os.path.join(util.getBaseDir(), pardir, pardir))
filePath = os.path.abspath(os.path.join(location, fileName))
#print location
#print filePath

# If config file doesn't exist, create with defaults
if not os.path.exists(os.path.join(location, fileName)):
    config = ConfigParser.RawConfigParser()
    config.add_section('Updates')
    if appName == 'AssetJet':
        config.set('Updates', 'url', r'http://www.assetjet.com/prod/downloads')
    elif appName == 'AssetJetDev':
        config.set('Updates', 'url', r'http://www.assetjet.com/dev/downloads')
    else: # when running from source
        config.set('Updates', 'url', r'http://localhost:8000')
    
    with open(os.path.join(location, fileName), 'w') as configfile:
        config.write(configfile)

class Cfg(ConfigParser.ConfigParser):
    def __init__(self, cfgFile=None):