def prepare_application(cls, beforeCreate, factory): from PyQt4.QtGui import QApplication, QMainWindow from lunchinator import get_settings from lunchinator.log import initializeLogger from lunchinator.log.lunch_logger import setGlobalLoggingLevel from lunchinator.utilities import setValidQtParent initializeLogger() get_settings().set_verbose(True) setGlobalLoggingLevel(logging.DEBUG) app = QApplication(sys.argv) beforeCreate() window = QMainWindow() setValidQtParent(window) window.setWindowTitle("Layout Example") window.resize(300, 300) window.setCentralWidget(factory(window)) window.showNormal() window.raise_() window.activateWindow() return window, app
def testURL(matcher, url): testMatch(matcher, url, [url]) testMatch(matcher, u"This is some text, this is a URL: " + url, [url]) testMatch(matcher, url + u" <- this was a URL", [url]) testMatch(matcher, u"There is a URL: " + url + u" in the middle", [url]) testMatch(matcher, url + u" test " + url + u" test " + url, [url, url, url]) def testBaseURL(matcher, baseURL): testURL(matcher, u"www." + baseURL) testURL(matcher, u"http://" + baseURL) testURL(matcher, u"http://www." + baseURL) initializeLogger() matcher = ChatWidget._URI_MATCHER testBaseURL(matcher, "google.de") testBaseURL(matcher, "google.de/foo/bar") testBaseURL(matcher, "google.de:8080") testBaseURL(matcher, "google.de:8080/") testBaseURL(matcher, "google.de:8080/foo/bar") testBaseURL(matcher, "google.de:8080/foo/bar#test") testBaseURL(matcher, "google.de:8080/foo/bar?search") testBaseURL(matcher, "google.de:8080/foo/bar?search#anchor") testBaseURL( matcher, "amazon.de/asdf-we-r-tr-t-/qw/Bo28374aSEF2/ref=ztrz_45_67?ie=UTF8&qid=46546878798789&sr=8-1&keywords=some+keywords", )
def setUp(self): self.split_size = 512 try: getCoreLogger() except: initializeLogger()
commands.executeCommands() # restart Lunchinator startCmd = options.startCmd if startCmd: args = json.loads(startCmd) getCoreLogger().info("Restarting Lunchinator: %s", ' '.join(args)) if platform.system()=="Windows": subprocess.Popen(args, creationflags=subprocess.CREATE_NEW_PROCESS_GROUP, close_fds=True) else: subprocess.call(args, close_fds=True) if __name__ == '__main__': (options, _args) = parse_args() lunchinatorPath = options.lunchinatorPath if lunchinatorPath: sys.path.insert(0, lunchinatorPath) from lunchinator import MAIN_CONFIG_DIR from lunchinator.log import initializeLogger, getCoreLogger initializeLogger(os.path.join(MAIN_CONFIG_DIR, "update.log")) try: from lunchinator.commands import Commands restart() except: getCoreLogger().exception("Unrecoverable error during restart.")
def initLogger(options, path=None): initializeLogger(path) if options.verbose: get_settings().set_verbose(True) setGlobalLoggingLevel(logging.DEBUG)