This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from robotide.controller.chiefcontroller import ChiefController | |
from robotide.controller.commands import NullObserver | |
from robotide.controller.filecontrollers import DirectoryController | |
from robotide.namespace import Namespace | |
from robotide.spec.iteminfo import LibraryKeywordInfo | |
from robotide.usages.commands import FindUsages | |
def construct_chief_controller(datapath): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import wx | |
print wx.__version__ | |
print sys.version_info | |
class MyFrame(wx.Frame): | |
def __init__(self, parent, id, title): | |
wx.Frame.__init__(self, parent, id, title) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from robot.libraries.BuiltIn import BuiltIn | |
def run_flat(name, *args): | |
""" | |
This keyword flattens robot logs. Only messages will be logged - no keyword structure. | |
""" | |
from robot.output import LOGGER | |
s, e = LOGGER.start_keyword, LOGGER.end_keyword | |
LOGGER.start_keyword = LOGGER.end_keyword = lambda *_:0 | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cProfile | |
import pstats | |
from robot.run import run_cli | |
import os, sys | |
import tempfile | |
profile_results = tempfile.mktemp(suffix='.out', prefix='pybot-profile', dir='.') | |
cProfile.run('run_cli(sys.argv[1:])', profile_results) | |
stats = pstats.Stats(profile_results) | |
stats.sort_stats('cumulative').print_stats(50) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2008-2012 Nokia Siemens Networks Oyj | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import total_ordering | |
from robot.api import ExecutionResult, ResultVisitor | |
import math, re | |
class KeywordTimes(ResultVisitor): | |
VAR_PATTERN = re.compile(r'^(\$|\@)\{[^\}]+\}(, \$\{[^\}]+\})* = ') | |
def __init__(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mport signal | |
import sys | |
import traceback | |
def debug(sig, frame): | |
""" This is a modified version of the one posted to http://stackoverflow.com/a/133384/308189 | |
This one only writes the traceback to real stdout as robot framework redirects the stdout | |
""" | |
message = "\nSignal recieved : \nTraceback:\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Printter(object): | |
ROBOT_LISTENER_API_VERSION = 2 | |
def __init__(self): | |
self._main_suite = True | |
self.passed_all = 0 | |
self.failed_all = 0 | |
self.passed_critical = 0 | |
self.failed_critical = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
SPLITTER = re.compile(r'\n(?=[^\s])', re.MULTILINE) | |
def files(path): | |
for root, dirs, files in os.walk(path): | |
for f in files: | |
if f.endswith('.txt') or f.endswith('.robot') or f.endswith('.tsv'): | |
yield os.path.join(root, f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from robot.api import ExecutionResult, ResultVisitor | |
from robot.utils import timestamp_to_secs as ts, secs_to_timestamp as st | |
res = ExecutionResult('output.xml') | |
class SuiteAndTestTimes(ResultVisitor): | |
def __init__(self): | |
self.result_by_start_time = [] | |
self.result_by_end_time = [] |
OlderNewer