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 reportlab.pdfgen import canvas | |
from reportlab.lib.pagesizes import A4 | |
class PDFHandler(webapp.RequestHandler): | |
def get(self): | |
self.response.headers['Content-Type'] = 'application/pdf' | |
self.response.headers['Content-Disposition'] = 'attachment; filename=my.pdf' | |
c = canvas.Canvas(self.response.out, pagesize=A4) | |
c.drawString(100, 100, "Hello world") |
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
#!/usr/bin/env python | |
#*_* coding=utf8 *_* | |
from flask import Flask | |
#app = Flask(__name__) | |
import simplejson | |
import logging | |
import random | |
import re | |
import datetime |
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
#!/usr/bin/env python | |
from __future__ import unicode_literals | |
from __future__ import print_function | |
from argparse import ArgumentParser | |
import json | |
import re | |
import sys | |
try: | |
#Py3 |
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
Public Sub SubjectList() | |
Dim TreeMgr As TreeManager | |
Dim SubjRoot As SubjectNode | |
Dim ChildNode As SubjectNode | |
Dim GrandChildNode As SubjectNode | |
Dim LeafNode As SubjectNode | |
Dim RootName As String | |
Dim Trees As List | |
Dim i% | |
'----------------------------------------------------- |
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
Private Sub CopyPasteTest(sourceFolderPath, destFolderPath, TestName) | |
'Copy a test, including design steps and parameters. | |
' For example: | |
' CopyPasteTest "Subject\TestFolder1", "Subject\TestFolder2", "Test1" | |
' Copies Test1 to TestFolder2 | |
Dim sourceFolder As SubjectNode | |
Dim destFolder As SubjectNode | |
Dim treeMng As TreeManager |
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
Public Sub TestFilesAndAttachments(theTest As TDAPIOLELib.Test) | |
' This routine gets a test object and | |
' first downloads the script files and then the attachments. | |
' The debug outputs are based on test: | |
' "OTA_DEMO_SUBJECT\OTA_SUBJECT_level1\OTA_SUB_1.2\SimpleVAPI-XP" | |
Dim TestAttachFact As AttachmentFactory | |
Dim attachList As List, TAttach As Attachment | |
Dim TestAttachStorage As IExtendedStorage |
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
Public Function GetTest(ByVal TestName As String, _ | |
ByVal SubjectPath As String, _ | |
Optional delimChar As String = "\") _ | |
As TDAPIOLELib.Test | |
'This function gets a test name and path and | |
'returns a test object. | |
Dim TestFact As TestFactory, testList As List | |
Dim TestFilter As TDFilter | |
On Error GoTo GetTestErr |
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
Public Function CheckForAnyMatch(reqID As Long) As HierarchySupportList | |
'############################################################### | |
' This example shows the use of the IHierarchyFilter to check | |
' whether there are any requirements in the project that match | |
' a filter, by not specifying an ID for the root of the search. | |
' Case A: There is at least one requirement that matches the filter | |
' Case B: There is no requirement in the project that matches the filter | |
' 2) Finding which sub-trees under a specific requirement contain at least | |
' one requirement that matches the filter. |
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
Public Function GetSubjectNodeByPath(ByVal fullPath As String, _ | |
Optional delimChar As String = "\") _ | |
As SubjectNode | |
' This function returns the Test SubjectNode object | |
' corresponding to the lowest level of a path. | |
' The path format is: | |
' "OTA_DEMO_SUBJECT\OTA_SUBJECT_level1\OTA_SUB_1.1\OTA_SUB_1.1.1\OTA_SUB_1.1.1.1" | |
' If a backslash is not used as the folder delimiter, any other | |
' character can be passed in the delimChar arguement. |
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
//inline void _cdecl WriteLog(LPCTSTR lpszFormat, ...) | |
void WriteLog(LPCTSTR lpszFormat, ...) { | |
va_list args; va_start(args, lpszFormat); | |
int nBuf; TCHAR szBuffer[512]; | |
nBuf = _vstprintf(szBuffer, lpszFormat, args); _ASSERTE(nBuf < sizeof(szBuffer)); | |
OutputDebugString(szBuffer); | |
va_end(args); | |
} |