From 7aae11ae123f078f9e37ce5013c7f6a6f0542e55 Mon Sep 17 00:00:00 2001 From: Himura Kazuto Date: Thu, 16 Sep 2021 22:21:04 +0300 Subject: [PATCH] Compile vk-inviter --- vk-inviter/make.ps1 | 29 +++++++++++++++++++++++++++++ vk-inviter/requirements.txt | 3 +++ vk-inviter/vk_inviter.py | 2 -- 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 vk-inviter/make.ps1 create mode 100644 vk-inviter/requirements.txt diff --git a/vk-inviter/make.ps1 b/vk-inviter/make.ps1 new file mode 100644 index 0000000..5beeb9a --- /dev/null +++ b/vk-inviter/make.ps1 @@ -0,0 +1,29 @@ +param ( + [switch] $InstallRequirements, + [switch] $InstallPyInstaller, + [switch] $Compile +) +Set-Location $PSScriptRoot +$didSomething = $false + +if ($InstallRequirements -or $InstallPyInstaller) { + & py -m pip install --user --upgrade pip +} +if ($InstallRequirements) { + & py -m pip install --user --upgrade -r ./requirements.txt + # The 'python3-tk' package is also required on Linux. + $didSomething = $true +} +if ($InstallPyInstaller) { + & py -m pip install --user --upgrade pyinstaller + $didSomething = $true +} +if ($Compile) { + & py -m PyInstaller --onefile --specpath ./build ./vk_inviter.py + Remove-Item -Recurse ./build, ./__pycache__ + $didSomething = $true +} + +if (!$didSomething) { + Get-Help $PSCommandPath +} \ No newline at end of file diff --git a/vk-inviter/requirements.txt b/vk-inviter/requirements.txt new file mode 100644 index 0000000..a4ea0ed --- /dev/null +++ b/vk-inviter/requirements.txt @@ -0,0 +1,3 @@ +PyYAML +Pillow +vk \ No newline at end of file diff --git a/vk-inviter/vk_inviter.py b/vk-inviter/vk_inviter.py index 5b8f2c0..3df0c18 100644 --- a/vk-inviter/vk_inviter.py +++ b/vk-inviter/vk_inviter.py @@ -6,8 +6,6 @@ from io import BytesIO from urllib.request import urlopen -# sudo apt install python3-tk -# pip install --user --upgrade PyYAML Pillow vk import tkinter as tk from PIL import Image, ImageTk import vk