This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| uses | |
| System.Zip; | |
| procedure CreateZipFile(): | |
| var | |
| ZipFile: TZipFile; | |
| begin | |
| // Creates a new instance of TZipFile | |
| ZipFile := TZipFile.Create; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var | |
| SelectedFile: string; | |
| begin | |
| if OpenDialog1.Execute then begin | |
| for SelectedFile in OpenDialog1.Files do | |
| ListBox1.Items.Add(SelectedFile); | |
| end; | |
| end; | |
| { Since the process is now dynamic, the method that compresses the files should be changed } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| procedure TForm1.OnProgressEvent(Sender: TObject; FileName: string; Header: TZipHeader; Position: Int64); | |
| var | |
| CurrentFileProgress: real; | |
| OverallProgress: real; | |
| begin | |
| Application.ProcessMessages; | |
| // Calculates the percentages | |
| CurrentFileProgress := Position / Header.UncompressedSize * 100; | |
| OverallProgress := (BytesProcessed + Position) / BytesToProcess * 100; | |
| // Updates the labels with each progress |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private | |
| procedure OnProgressEvent(Sender: TObject; FileName: string; Header: TZipHeader; Position: Int64); | |
| { … } | |
| procedure TForm1.OnProgressEvent(Sender: TObject; FileName: string; Header: TZipHeader; Position: Int64); | |
| begin | |
| Application.ProcessMessages; | |
| // Displays the compression percentage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private | |
| function GetFileSize(const FileName: string): integer; | |
| { … } | |
| function TForm1.GetFileSize(const FileName: string): integer; | |
| var | |
| StreamArchive: TFileStream; | |
| begin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import sys | |
| import json | |
| import ast | |
| import datetime | |
| import django | |
| orm_dir_path = os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), 'server/my_orm') | |
| server_dir_path = os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), 'server') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import signal | |
| import asyncio | |
| from typing import Optional, Awaitable | |
| import tornado.httpserver | |
| import tornado.ioloop | |
| import tornado.options | |
| import tornado.web |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import signal | |
| import asyncio | |
| from typing import Optional, Awaitable | |
| import tornado.httpserver | |
| import tornado.ioloop | |
| import tornado.options | |
| import tornado.web |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| procedure TFrmMain.FormCreate(Sender: TObject); | |
| begin | |
| inherited; | |
| { TODO: Initialized objects } | |
| end; | |
| procedure TFrmMain.BtnSaveClick(Sender: TObject); | |
| begin | |
| inherited; | |
| { TODO: Encrypt and save json file } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| procedure TFrmMain.BtnSaveClick(Sender: TObject); | |
| begin | |
| inherited; | |
| Memo1.Lines.Add('Saving...'); | |
| Memo1.Lines.Add(TTodoProgSettings.GetSettingsFolder); | |
| Memo1.Lines.Add(TTodoProgSettings.GetDefaultSettingsFilename); | |
| Todos.Name := 'test me'; | |
| TTodoProgSettings.SaveTodos(Todos); | |
| end; |