def drawCrossFunc(self):
        crossFuncPeople = self.multiOrgParser.getCrossFuncPeople()

        if not len(crossFuncPeople):
            return

        chartDrawer = DrawChartSlide(self.presentation, "Cross Functional", self.slideLayout)

        functions = list(set([aPerson.getFunction() for aPerson in crossFuncPeople]))
        functions.sort(cmp=self._sortByFunc)

        for aFunction in functions:
            peopleFilter = PeopleFilter()
            peopleFilter.addFunctionFilter(aFunction)
            peopleFilter.addIsCrossFuncFilter()
            peopleFilter.addIsExpatFilter(False)
            peopleFilter.addIsInternFilter(False)

            funcPeople = self.multiOrgParser.getFilteredPeople(peopleFilter)
            self.buildGroup(aFunction, funcPeople, chartDrawer)
        chartDrawer.drawSlide()
    def drawCrossFunc(self):
        crossFuncPeople = self.multiOrgParser.getCrossFuncPeople()

        if not len(crossFuncPeople):
            return

        chartDrawer = DrawChartSlide(self.presentation, "Cross Functional",
                                     self.slideLayout)

        functions = list(
            set([aPerson.getFunction() for aPerson in crossFuncPeople]))
        functions.sort(cmp=self._sortByFunc)

        for aFunction in functions:
            peopleFilter = PeopleFilter()
            peopleFilter.addFunctionFilter(aFunction)
            peopleFilter.addIsCrossFuncFilter()
            peopleFilter.addIsExpatFilter(False)
            peopleFilter.addIsInternFilter(False)

            funcPeople = self.multiOrgParser.getFilteredPeople(peopleFilter)
            self.buildGroup(aFunction, funcPeople, chartDrawer)
        chartDrawer.drawSlide()
    def drawProduct(self,
                    productName,
                    drawFeatureTeams=False,
                    drawLocations=False,
                    drawExpatsInTeam=True):
        """

        :type productName: str
        """
        if not productName:
            if not self.draftMode:
                return

        featureTeamList = [""]
        if drawFeatureTeams:
            featureTeamList = list(
                self.multiOrgParser.getFeatureTeamSet(productName))

        functionList = list(self.multiOrgParser.getFunctionSet(productName))
        functionList.sort(cmp=self._sortByFunc)

        teamModelText = None

        locations = [""]

        # If draw locations has been set (could still be an empty list) then break the chart up by locations.
        # if locations is set and isn't an empty list, only show the locations specified.
        if drawLocations is not None:
            locations = self.multiOrgParser.getLocationSet(productName)
            for drawLocation in drawLocations:
                if drawLocation not in locations:
                    raise ValueError(
                        "{} is not found in available locations: {}".format(
                            drawLocations, locations))

        for aLocation in drawLocations or locations:
            locationName = aLocation.strip() or self.multiOrgParser.getOrgName(
            )

            for aFeatureTeam in featureTeamList:
                if not productName:
                    slideTitle = orgchart_parser.NOT_SET
                elif drawFeatureTeams:
                    teamName = "- {} ".format(aFeatureTeam)
                    if not aFeatureTeam:
                        if len(featureTeamList) > 1:
                            teamName = "- Cross "
                        else:
                            teamName = ""
                    slideTitle = "{} {}Feature Team".format(
                        productName, teamName)
                else:
                    slideTitle = "{}".format(productName)
                    modelDict = self.multiOrgParser.getTeamModel()
                    if productName in modelDict:
                        teamModelText = modelDict[productName]

                chartDrawer = DrawChartSlide(self.presentation, slideTitle,
                                             self.slideLayout, teamModelText)
                if len(locations) > 1 and aLocation:
                    chartDrawer.setLocation(locationName)

                for aFunction in functionList:
                    if aFunction.lower(
                    ) in self.multiOrgParser.getCrossFunctions():
                        continue

                    peopleFilter = PeopleFilter()
                    peopleFilter.addProductFilter(productName)
                    peopleFilter.addFunctionFilter(aFunction)
                    if drawLocations is not None:
                        peopleFilter.addLocationFilter(aLocation)

                    if drawFeatureTeams:
                        peopleFilter.addFeatureTeamFilter(aFeatureTeam)
                    else:
                        if not drawExpatsInTeam:
                            peopleFilter.addIsExpatFilter(False)
                        peopleFilter.addIsInternFilter(False)
                        # peopleFilter.addIsProductManagerFilter(False)

                    functionPeople = self.multiOrgParser.getFilteredPeople(
                        peopleFilter)
                    self.buildGroup(aFunction, functionPeople, chartDrawer)

                chartDrawer.drawSlide()
    def drawProduct(self, productName, drawFeatureTeams=False, drawLocations=False, drawExpatsInTeam=True):
        """

        :type productName: str
        """
        if not productName:
            if not self.draftMode:
                return

        featureTeamList = [""]
        if drawFeatureTeams:
            featureTeamList = list(self.multiOrgParser.getFeatureTeamSet(productName))

        functionList = list(self.multiOrgParser.getFunctionSet(productName))
        functionList.sort(cmp=self._sortByFunc)

        teamModelText = None

        locations = [""]

        # If draw locations has been set (could still be an empty list) then break the chart up by locations.
        # if locations is set and isn't an empty list, only show the locations specified.
        if drawLocations is not None:
            locations = self.multiOrgParser.getLocationSet(productName)
            for drawLocation in drawLocations:
                if drawLocation not in locations:
                    raise ValueError("{} is not found in available locations: {}".format(drawLocations, locations))


        for aLocation in drawLocations or locations:
            locationName = aLocation.strip() or self.multiOrgParser.getOrgName()

            for aFeatureTeam in featureTeamList:
                if not productName:
                    slideTitle = orgchart_parser.NOT_SET
                elif drawFeatureTeams:
                    teamName = "- {} ".format(aFeatureTeam)
                    if not aFeatureTeam:
                        if len(featureTeamList) > 1:
                            teamName = "- Cross "
                        else:
                            teamName = ""
                    slideTitle = "{} {}Feature Team".format(productName, teamName)
                else:
                    slideTitle = "{}".format(productName)
                    modelDict = self.multiOrgParser.getTeamModel()
                    if productName in modelDict:
                        teamModelText = modelDict[productName]

                chartDrawer = DrawChartSlide(self.presentation, slideTitle, self.slideLayout, teamModelText)
                if len(locations) > 1 and aLocation:
                   chartDrawer.setLocation(locationName)

                for aFunction in functionList:
                    if aFunction.lower() in self.multiOrgParser.getCrossFunctions():
                        continue

                    peopleFilter = PeopleFilter()
                    peopleFilter.addProductFilter(productName)
                    peopleFilter.addFunctionFilter(aFunction)
                    if drawLocations is not None:
                        peopleFilter.addLocationFilter(aLocation)

                    if drawFeatureTeams:
                        peopleFilter.addFeatureTeamFilter(aFeatureTeam)
                    else:
                        if not drawExpatsInTeam:
                            peopleFilter.addIsExpatFilter(False)
                        peopleFilter.addIsInternFilter(False)
                        # peopleFilter.addIsProductManagerFilter(False)

                    functionPeople = self.multiOrgParser.getFilteredPeople(peopleFilter)
                    self.buildGroup(aFunction, functionPeople, chartDrawer)

                chartDrawer.drawSlide()