import os
import time
import json
from xhtml2pdf import pisa


class PDF:
    def __init__(self, html):
        self.path = None
        self.html = html

    def save(self, path, name, date_time):
        n = '%s %s.pdf' % (name, date_time)
        p = os.path.abspath(os.path.join(path, n))
        self.path = p
        self.convert_and_save()

    def convert_and_save(self):
        result_file = open(self.path, "w+b")
        pisa_status = pisa.CreatePDF(
            self.html,
            dest=result_file)
        result_file.close()

cb3792d4697bf54019f895b7328ad671bc85d9b9
<mask token>


class PDF:
    <mask token>
    <mask token>
    <mask token>

<mask token>


class PDF:

    def __init__(self, html):
        self.path = None
        self.html = html
    <mask token>

    def convert_and_save(self):
        result_file = open(self.path, 'w+b')
        pisa_status = pisa.CreatePDF(self.html, dest=result_file)
        result_file.close()

<mask token>


class PDF:

    def __init__(self, html):
        self.path = None
        self.html = html

    def save(self, path, name, date_time):
        n = '%s %s.pdf' % (name, date_time)
        p = os.path.abspath(os.path.join(path, n))
        self.path = p
        self.convert_and_save()

    def convert_and_save(self):
        result_file = open(self.path, 'w+b')
        pisa_status = pisa.CreatePDF(self.html, dest=result_file)
        result_file.close()

import os
import time
import json
from xhtml2pdf import pisa


class PDF:

    def __init__(self, html):
        self.path = None
        self.html = html

    def save(self, path, name, date_time):
        n = '%s %s.pdf' % (name, date_time)
        p = os.path.abspath(os.path.join(path, n))
        self.path = p
        self.convert_and_save()

    def convert_and_save(self):
        result_file = open(self.path, 'w+b')
        pisa_status = pisa.CreatePDF(self.html, dest=result_file)
        result_file.close()

import os
import time
import json
from xhtml2pdf import pisa


class PDF:
    def __init__(self, html):
        self.path = None
        self.html = html

    def save(self, path, name, date_time):
        n = '%s %s.pdf' % (name, date_time)
        p = os.path.abspath(os.path.join(path, n))
        self.path = p
        self.convert_and_save()

    def convert_and_save(self):
        result_file = open(self.path, "w+b")
        pisa_status = pisa.CreatePDF(
            self.html,
            dest=result_file)
        result_file.close()
