예제 #1
0
    def generateBadge(self, csvCertFile, config):

        pathToSave = './webPageDataGen'

        self.mdGen = mdGen()

        self.allCertificates = AllCertificates()
        self.certificateDataLoder = CertificateDataLoder()
        self.event = AnEvent()
        self.allCertificates = AllCertificates()
        self.issue = AuthorCertificate()
        self.ad = Advertisement()
        self.configurationLoader = ConfigurationLoader(self.event,
                                                       self.allCertificates,
                                                       self.issue, self.ad)

        self.configurationLoader.loadConfig(config)
        certificates = self.allCertificates.getAllCertificates()
        self.certificateDataLoder = self.certificateDataLoder.load(
            certificates, csvCertFile, False)

        URL = "https://certifyme.online/"

        self.mdGen.genMDBulkIssueBadge(
            pathToSave + "/" + "_" + self.event.getEventCode(),
            self.event.getEventCode(), URL, self.allCertificates)

        defaultFile = self.mdGen.genDefaults(pathToSave, self.issue,
                                             self.event, self.ad)
        self.genLinkCSVFile(self.allCertificates)
예제 #2
0
    def setUp(self):
        self.allCertificates = AllCertificates()
        self.certificateDataLoder = CertificateDataLoder()
        self.event = AnEvent()
        self.allCertificates = AllCertificates()
        self.issue = AuthorCertificate()
        self.ad = Advertisement()
        self.configurationLoader = ConfigurationLoader(self.event,
                                                       self.allCertificates,
                                                       self.issue, self.ad)

        self.f = open('config.yaml', "w")
        self.f.write("Program : XP2020" + "\n")
        self.f.write("IssuedBy : Anju M Dominic" + "\n")
        self.f.write("Institution : Quadralogics" + "\n")
        self.f.write("Date : 29 dec 1982" + "\n")
        self.f.write("Text : A write-up about the event" + "\n")
        self.f.write("Template : ./AnuMDominicnew.png" + "\n")
        self.f.write("Logo : ./logo.png" + "\n")
        self.f.write(
            "Message : As your organizations progresses through its DevXOps journey, what are the best practices that successful teams use that you should follow? Discover what separates successful DevXOps teams from those that fail, and learn the next steps to take on your DevXOps journey"
            + "\n")
        self.f.write("Banner : ./banner.png" + "\n")
        self.f.write("CTAMessage : Download our E-Book to learn more" + "\n")
        self.f.write("CTALink : www.q.com" + "\n")
        self.f.write("CTALabel : Dload" + "\n")
        self.f.write("Phone : 898654423" + "\n")
        self.f.write("Email : [email protected]" + "\n")
        self.f.write("WebLink : www.qt.com" + "\n")
        self.f.write("Font : ./res/AngelicaCaroline.ttf" + "\n")
        self.f.write("FontSize : 100" + "\n")
        self.f.write("NameX : 150" + "\n")
        self.f.write("NameY : 160" + "\n")
        self.f.write("QRCodeX : 1500" + "\n")
        self.f.write("QRCodeY : 1600" + "\n")
        self.f.write("QRCodeFrontColor : white" + "\n")
        self.f.write("QRCodeBackColor : black" + "\n")
        self.f.write("QRCodeSize : 10" + "\n")
        self.f.write("EventCode : AgilePCR2021" + "\n")

        self.f.close()
        self.configurationLoader.loadConfig("config.yaml")
예제 #3
0
    def setUp(self):

        self.mdGen = mdGen()
        self.webPageDataGen = webPageDataGen()

        self.allCertificates = AllCertificates()
        self.certificateDataLoder = CertificateDataLoder()
        self.event = AnEvent()
        self.allCertificates = AllCertificates()
        self.issue = AuthorCertificate()
        self.ad = Advertisement()
        self.configurationLoader = ConfigurationLoader(self.event,
                                                       self.allCertificates,
                                                       self.issue, self.ad)

        self.f = open('config.yaml', "w")
        self.f.write("Program : XP2020" + "\n")
        self.f.write("IssuedBy : Anju M Dominic" + "\n")
        self.f.write("Institution : Quadralogics" + "\n")
        self.f.write("Date : 29 dec 1982" + "\n")
        self.f.write("Text : A write-up about the event" + "\n")
        self.f.write("Template : ./test/data/AgileNCR_Participation.png" +
                     "\n")
        self.f.write("Logo : ./logo.png" + "\n")
        self.f.write(
            "Message : As your organizations progresses through its DevXOps journey, what are the best practices that successful teams use that you should follow? Discover what separates successful DevXOps teams from those that fail, and learn the next steps to take on your DevXOps journey"
            + "\n")
        self.f.write("Banner : ./banner.png" + "\n")
        self.f.write("CTAMessage : Download our E-Book to learn more" + "\n")
        self.f.write("CTALink : www.q.com" + "\n")
        self.f.write("CTALabel : Dload" + "\n")
        self.f.write("Phone : 898654423" + "\n")
        self.f.write("Email : [email protected]" + "\n")
        self.f.write("WebLink : www.qt.com" + "\n")
        self.f.write("Font : ./res/Font Pack/Ubuntu-B.ttf" + "\n")
        self.f.write("FontSize : 50" + "\n")
        self.f.write("NameX : 150" + "\n")
        self.f.write("NameY : 160" + "\n")
        self.f.write("QRCodeX : 1500" + "\n")
        self.f.write("QRCodeY : 1600" + "\n")
        self.f.write("QRCodeFrontColor : white" + "\n")
        self.f.write("QRCodeBackColor : black" + "\n")
        self.f.write("QRCodeSize : 10" + "\n")
        self.f.write("EventCode: AgileNCR" + "\n")
        self.f.close()
        self.configurationLoader.loadConfig("config.yaml")

        self.f = open('names.csv', "w")
        self.f.write("No,First Name ,Second Name" + "\n")
        self.f.write("1 ,ranjith, tharayil " + "\n")
        self.f.write("2 ,anju, M dominic " + "\n")
        self.f.write("3 ,Suraj, Meaheta " + "\n")
        self.f.close()
예제 #4
0
    def generate(self, csvCertFile, config):

        pathToSave = './webPageDataGen'

        self.mdGen = mdGen()

        self.allCertificates = AllCertificates()
        self.certificateDataLoder = CertificateDataLoder()
        self.event = AnEvent()
        self.allCertificates = AllCertificates()
        self.issue = AuthorCertificate()
        self.ad = Advertisement()
        self.configurationLoader = ConfigurationLoader(self.event,
                                                       self.allCertificates,
                                                       self.issue, self.ad)

        self.configurationLoader.loadConfig(
            "./test/data//SYNAPSE//config1.yaml")
        certificates = self.allCertificates.getAllCertificates()
        self.certificateDataLoder = self.certificateDataLoder.load(
            certificates, './test/data//SYNAPSE//names.csv', False)

        URL = "https://certifyme.online/CSIT/SYNAPSE/SYNAPSEQA2020/"
        certificateFile = self.issue.BulkIssue(
            pathToSave + "/" + self.event.getEventCode(),
            URL,
            self.allCertificates,
            eventCode=self.event.getEventCode())

        URL = URL + self.event.getEventCode() + "/"

        self.mdGen.genMDBulkIssue(
            pathToSave + "/" + "_" + self.event.getEventCode(), URL,
            self.allCertificates)

        defaultFile = self.mdGen.genDefaults(pathToSave, self.issue,
                                             self.event, self.ad)
        self.genLinkCSVFile(self.allCertificates)
예제 #5
0
class test_ConfigurationLoader(unittest.TestCase):
    def setUp(self):
        self.allCertificates = AllCertificates()
        self.certificateDataLoder = CertificateDataLoder()
        self.event = AnEvent()
        self.allCertificates = AllCertificates()
        self.issue = AuthorCertificate()
        self.ad = Advertisement()
        self.configurationLoader = ConfigurationLoader(self.event,
                                                       self.allCertificates,
                                                       self.issue, self.ad)

        self.f = open('config.yaml', "w")
        self.f.write("Program : XP2020" + "\n")
        self.f.write("IssuedBy : Anju M Dominic" + "\n")
        self.f.write("Institution : Quadralogics" + "\n")
        self.f.write("Date : 29 dec 1982" + "\n")
        self.f.write("Text : A write-up about the event" + "\n")
        self.f.write("Template : ./AnuMDominicnew.png" + "\n")
        self.f.write("Logo : ./logo.png" + "\n")
        self.f.write(
            "Message : As your organizations progresses through its DevXOps journey, what are the best practices that successful teams use that you should follow? Discover what separates successful DevXOps teams from those that fail, and learn the next steps to take on your DevXOps journey"
            + "\n")
        self.f.write("Banner : ./banner.png" + "\n")
        self.f.write("CTAMessage : Download our E-Book to learn more" + "\n")
        self.f.write("CTALink : www.q.com" + "\n")
        self.f.write("CTALabel : Dload" + "\n")
        self.f.write("Phone : 898654423" + "\n")
        self.f.write("Email : [email protected]" + "\n")
        self.f.write("WebLink : www.qt.com" + "\n")
        self.f.write("Font : ./res/AngelicaCaroline.ttf" + "\n")
        self.f.write("FontSize : 100" + "\n")
        self.f.write("NameX : 150" + "\n")
        self.f.write("NameY : 160" + "\n")
        self.f.write("QRCodeX : 1500" + "\n")
        self.f.write("QRCodeY : 1600" + "\n")
        self.f.write("QRCodeFrontColor : white" + "\n")
        self.f.write("QRCodeBackColor : black" + "\n")
        self.f.write("QRCodeSize : 10" + "\n")
        self.f.write("EventCode : AgilePCR2021" + "\n")

        self.f.close()
        self.configurationLoader.loadConfig("config.yaml")

    def test_loadConfig_EventName(self):

        self.assertEqual('XP2020', self.event.getProgram())

    def test_loadConfig_issuedBy(self):

        self.assertEqual('Anju M Dominic', self.event.getIssuer())

    def test_loadConfig_institution(self):

        self.assertEqual('Quadralogics', self.event.getInstitution())

    def test_loadConfig_date(self):

        self.assertEqual('29 dec 1982', self.event.getDate())

    def test_loadConfig_EventCode(self):

        self.assertEqual('AgilePCR2021', self.event.getEventCode())

    def test_loadConfig_text(self):

        self.assertEqual('A write-up about the event', self.event.getText())

    def test_loadConfig_template(self):

        self.assertEqual('./AnuMDominicnew.png',
                         self.allCertificates.getTemplate())

    def test_loadConfig_logo(self):

        self.assertEqual('./logo.png', self.ad.getLogo())

    def test_loadConfig_Message(self):

        self.assertEqual(
            'As your organizations progresses through its DevXOps journey, what are the best practices that successful teams use that you should follow? Discover what separates successful DevXOps teams from those that fail, and learn the next steps to take on your DevXOps journey',
            self.ad.getMessage())

    def test_loadConfig_Banner(self):

        self.assertEqual('./banner.png', self.ad.getBanner())

    def test_loadConfig_CTAMessage(self):

        self.assertEqual('Download our E-Book to learn more',
                         self.ad.getCTAMessage())

    def test_loadConfig_CTAMessage(self):

        self.assertEqual('Dload', self.ad.getButtonLabel())

    def test_loadConfig_CTALink(self):

        self.assertEqual('www.q.com', self.ad.getCTALink())

    def test_loadConfig_phone(self):

        self.assertEqual(898654423, self.ad.getPhone())

    def test_loadConfig_email(self):

        self.assertEqual('*****@*****.**', self.ad.getEmail())

    def test_loadConfig_Weblink(self):

        self.assertEqual('www.qt.com', self.ad.getWebLink())

    def test_loadConfig_font(self):

        font, size = self.issue.getNameFont()

        self.assertEqual('./res/AngelicaCaroline.ttf', font)
        self.assertEqual(100, size)

    def test_loadConfig_NamePos(self):
        x, y = self.issue.getNameLocation()
        self.assertEqual(150, x)
        self.assertEqual(160, y)

    def test_loadConfig_QRCodePos(self):
        x, y = self.issue.getQRCodeLocation()
        self.assertEqual(1500, x)
        self.assertEqual(1600, y)

    def test_loadConfig_QRCodeColor(self):
        fg, bg = self.issue.getQRCodeColor()
        self.assertEqual('white', fg)
        self.assertEqual('black', bg)

    def test_loadConfig_QRCodeSize(self):

        self.assertEqual(10, self.issue.getQRCodeSize())
예제 #6
0
class webPageDataGen:
    """All Certificates """

    # default constructor
    def __init__(self):
        X = 0

    def generate(self, csvCertFile, config):

        pathToSave = './webPageDataGen'

        self.mdGen = mdGen()

        self.allCertificates = AllCertificates()
        self.certificateDataLoder = CertificateDataLoder()
        self.event = AnEvent()
        self.allCertificates = AllCertificates()
        self.issue = AuthorCertificate()
        self.ad = Advertisement()
        self.configurationLoader = ConfigurationLoader(self.event,
                                                       self.allCertificates,
                                                       self.issue, self.ad)

        self.configurationLoader.loadConfig(
            "./test/data//SYNAPSE//config1.yaml")
        certificates = self.allCertificates.getAllCertificates()
        self.certificateDataLoder = self.certificateDataLoder.load(
            certificates, './test/data//SYNAPSE//names.csv', False)

        URL = "https://certifyme.online/CSIT/SYNAPSE/SYNAPSEQA2020/"
        certificateFile = self.issue.BulkIssue(
            pathToSave + "/" + self.event.getEventCode(),
            URL,
            self.allCertificates,
            eventCode=self.event.getEventCode())

        URL = URL + self.event.getEventCode() + "/"

        self.mdGen.genMDBulkIssue(
            pathToSave + "/" + "_" + self.event.getEventCode(), URL,
            self.allCertificates)

        defaultFile = self.mdGen.genDefaults(pathToSave, self.issue,
                                             self.event, self.ad)
        self.genLinkCSVFile(self.allCertificates)

    def generateBadge(self, csvCertFile, config):

        pathToSave = './webPageDataGen'

        self.mdGen = mdGen()

        self.allCertificates = AllCertificates()
        self.certificateDataLoder = CertificateDataLoder()
        self.event = AnEvent()
        self.allCertificates = AllCertificates()
        self.issue = AuthorCertificate()
        self.ad = Advertisement()
        self.configurationLoader = ConfigurationLoader(self.event,
                                                       self.allCertificates,
                                                       self.issue, self.ad)

        self.configurationLoader.loadConfig(config)
        certificates = self.allCertificates.getAllCertificates()
        self.certificateDataLoder = self.certificateDataLoder.load(
            certificates, csvCertFile, False)

        URL = "https://certifyme.online/"

        self.mdGen.genMDBulkIssueBadge(
            pathToSave + "/" + "_" + self.event.getEventCode(),
            self.event.getEventCode(), URL, self.allCertificates)

        defaultFile = self.mdGen.genDefaults(pathToSave, self.issue,
                                             self.event, self.ad)
        self.genLinkCSVFile(self.allCertificates)

    def genLinkCSVFile(self, allCertificates):
        self.f = open('./webPageDataGen/namesWithLink.csv', "w")
        self.f.write("No,First Name ,Second Name , email ,Link" + "\n")
        i = 0

        for cert in allCertificates.getAllCertificates():
            i = i + 1
            firstName, secondName = cert.getName()

            line = str(
                i) + "," + firstName + "," + secondName + "," + cert.Email(
                ) + "," + cert.getWebURL() + "\n"

            self.f.write(line)

        self.f.close()