archiTop/deck_builder/final_deck_builder.py
def save_deck(self, export_location: str = None):
        """Saves deck and thumbnail.
        Filename is determined by the chosen deck name.

        If system is mac os, output will be saved to the tabletop location,
        otherwise it will be stored to current directory.

        Args:
            export_location:    Optional argument to overwrite output location
        """
        deck_name = f'{self.deck.name}.json'
        thumbnail_name = f'{self.deck.name}.png'

        log_message = f'deck <{self.deck.name}>'

        if export_location:
            log_message += f' to passed location <{export_location}>'

        else:
            if sys.platform == 'darwin':  # client is using mac os
                log_message += ' to tabletop location'
                table_top_save_location = load_config()['EXPORT']['MAC']
                export_location = Path(Path.home(), table_top_save_location)

            else:
                log_message += ' to current directory'
                export_location = ''

        spin_logger.debug('Saving %s', log_message, extra={'user_waiting': True})
        # save deck json
        json.dump(self.final_deck_json, open(Path(export_location, deck_name), 'w'))
        # save deck thumbnail
        if self.deck.thumbnail:
            with open(Path(export_location, thumbnail_name), 'wb') as file:
                file.write(self.deck.thumbnail)
        spin_logger.debug('Saved %s', log_message, extra={'user_waiting': False})
Saves deck and thumbnail.
        Filename is determined by the chosen deck name.

        If system is mac os, output will be saved to the tabletop location,
        otherwise it will be stored to current directory.

        Args:
            export_location:    Optional argument to overwrite output location
        
Saves deck and thumbnail.
Filename is determined by the chosen deck name.

If system is mac os, output will be saved to the tabletop location,
otherwise it will be stored to current directory.
Saves deck and thumbnail . Filename is determined by the chosen deck name . If system is mac os output will be saved to the tabletop location otherwise it will be stored to current directory .
def save_deck(self, export_location: str = None):
        deck_name = f'{self.deck.name}.json'
        thumbnail_name = f'{self.deck.name}.png'
        log_message = f'deck <{self.deck.name}>'
        if export_location:
            log_message += f' to passed location <{export_location}>'
        else:
            if sys.platform == 'darwin':  
                log_message += ' to tabletop location'
                table_top_save_location = load_config()['EXPORT']['MAC']
                export_location = Path(Path.home(), table_top_save_location)
            else:
                log_message += ' to current directory'
                export_location = ''
        spin_logger.debug('Saving %s', log_message, extra={'user_waiting': True})
        json.dump(self.final_deck_json, open(Path(export_location, deck_name), 'w'))
        if self.deck.thumbnail:
            with open(Path(export_location, thumbnail_name), 'wb') as file:
                file.write(self.deck.thumbnail)
        spin_logger.debug('Saved %s', log_message, extra={'user_waiting': False})
def save_deck ( self , export_location : str = None ) : deck_name = f'{self.deck.name}.json' thumbnail_name = f'{self.deck.name}.png' log_message = f'deck <{self.deck.name}>' if export_location : log_message += f' to passed location <{export_location}>' else : if sys . platform == 'darwin' : log_message += ' to tabletop location' table_top_save_location = load_config ( ) [ 'EXPORT' ] [ 'MAC' ] export_location = Path ( Path . home ( ) , table_top_save_location ) else : log_message += ' to current directory' export_location = '' spin_logger . debug ( 'Saving %s' , log_message , extra = { 'user_waiting' : True } ) json . dump ( self . final_deck_json , open ( Path ( export_location , deck_name ) , 'w' ) ) if self . deck . thumbnail : with open ( Path ( export_location , thumbnail_name ) , 'wb' ) as file : file . write ( self . deck . thumbnail ) spin_logger . debug ( 'Saved %s' , log_message , extra = { 'user_waiting' : False } )
Saves deck and thumbnail.
Saves deck and thumbnail .
"""Saves deck and thumbnail.
        Filename is determined by the chosen deck name.

        If system is mac os, output will be saved to the tabletop location,
        otherwise it will be stored to current directory.

        Args:
            export_location:    Optional argument to overwrite output location
        """ # client is using mac os # save deck json # save deck thumbnail
self
export_location
str
Optional argument to overwrite output location
Optional argument to overwrite output location