(self, packages, dir=None)
Writes a file for each package in supplied list of packages.

        Keyword arguments:
        packages -- list of STIX_Package etree Element objects
Writes a file for each package in supplied list of packages.
Writes a file for each package in supplied list of packages .
def write_packages(self, packages, dir=None):
        """Writes a file for each package in supplied list of packages.

        Keyword arguments:
        packages -- list of STIX_Package etree Element objects
        """
        count = 1
        day = datetime.date.today().strftime("%Y%m%d")

        for package in packages:
            fn = 'ciscp-'+ day +'-' + str(count) + ".xml"

            if dir:
                path_output = os.path.join(dir, fn)
            else:
                path_output = fn

            et = etree.ElementTree(package)
            et.write(path_output, pretty_print=True)
            count = count + 1
def write_packages ( self , packages , dir = None ) : count = 1 day = datetime . date . today ( ) . strftime ( "%Y%m%d" ) for package in packages : fn = 'ciscp-' + day + '-' + str ( count ) + ".xml" if dir : path_output = os . path . join ( dir , fn ) else : path_output = fn et = etree . ElementTree ( package ) et . write ( path_output , pretty_print = True ) count = count + 1