Ejemplo n.º 1
0
    def load_master(self, *args):
        z = storagepath.get_documents_dir()
        m = filechooser.open_file()
        get_master(m)
        self.dialog1.dismiss()

        self.loc()
Ejemplo n.º 2
0
def save(lis, name):
    z = storagepath.get_documents_dir()

    if os.path.exists(name[0]):

        upload_2(name[0], lis)
    else:
        os.mkdir(f"{z}/Helper Export/")
        upload_1(f"{z}/Helper Export/{name}.xlsx", lis)
Ejemplo n.º 3
0
 def init_dir(self):
     # Création du dossier d'enregistrement
     if ANDROID:
         extern = storagepath.get_documents_dir()
     else:
         extern = "."
     dt = datetime.now().strftime("%Y_%m_%d_%H_%M_%S")
     self.my_path_directory = f"{extern}/accelerometer/acc_{dt}"
     print(f"Documents Storage = {extern}")
     print(f"Dossier d'enregistrement des datas = {self.my_path_directory}")
     create_dir(self.my_path_directory)
Ejemplo n.º 4
0
 def __init__(self):
     self.extra = False
     self.list = []
     self.doc = storagepath.get_documents_dir()
     if os.path.exists(f"{self.doc}\\Helper"):
         pass
     else:
         os.mkdir(f"{self.doc}\\Helper")
     self.doc_loc = f"{self.doc}\\Helper"
     self.frame2 = frame2
     filemenu.entryconfig("New Department", command=self.create_new)
     filemenu.entryconfig("Load Department", command=self.load_existing)
Ejemplo n.º 5
0
 def __init__(self):
     self.remark_list = []
     self.current = 0
     self.doc = storagepath.get_documents_dir()
     if os.path.exists(f"{self.doc}\\Helper"):
         pass
     else:
         os.mkdir(f"{self.doc}\\Helper")
     self.doc_loc = f"{self.doc}\\Helper"
     self.framer()
     # self.jump_start()
     self.new = False
     self.lowd = False
     filemenu.entryconfig("New Department", command=self.jump_start)
     filemenu.entryconfig("Load Department", command=self.load_start)
Ejemplo n.º 6
0
    def save(self):
        if self.ids.reg_no.text and self.ids.remarks.text:
            self.df[int(self.target)]['REMARK'] = self.ids.remarks.text

            if slave:
                if self.found:
                    z = download(slave)
                    self.go = True
                    for v in z:
                        if self.ids.reg_no.text in v['REGNO']:
                            self.go = False
                            break
                    if self.go is True:
                        z.append(self.df[int(self.target)])
                        upload_2(slave, z)
            elif name:

                f = storagepath.get_documents_dir()
                n = []

                n.append(self.df[int(self.target)])
                if os.path.exists(f"{f}/Helper Export/"):

                    upload_1(f"{f}/Helper Export/{name}.xlsx", n)
                else:
                    os.mkdir(f"{f}/Helper Export/")

                    upload_1(f"{f}/Helper Export/{name}.xlsx", n)
                get_slave([f"{f}/Helper Export/{name}.xlsx"])

            self.others = False
            self.ids.remarks.hint_text = "Select Remark"
            self.ids.reg_no.text = ""
            self.ids.remarks.text = ""

        else:
            self.warning = MDDialog(title="Warning",
                                    text="Please Fill All Values",
                                    buttons=[MDFlatButton(text="CLose")])
            self.warning.open()
    def _get_output_pdf_name(self, filename="printme"):
        """
        Finds out where to save the pdf to

        Currently asks the user but could be changed to give a tmp directory before sending the file to the printer
        """

        if config.IS_WINDOWS:
            # Quick change to avoid crashes when built
            path = str(config.my_datadir / "prints")
        else:
            doc_dir = storagepath.get_documents_dir()
            recommended_path = os.path.join(doc_dir, filename)
            path = filechooser.choose_dir(multiple=False, path=recommended_path)
        if isinstance(path, List):
            if len(path) > 0:
                path = path[0]
            else:
                raise CancelPrintError()
        print(path)
        output_file = os.path.join(path, filename)
        output_file += f"{''.join(str(time.time()).split('.'))}.pdf"
        return output_file