This repository has been archived by the owner on Apr 20, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add (yapi_new.py): this commit introduce the new standard and rewrite…
- Loading branch information
Showing
6 changed files
with
84 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[DEFAULT] | ||
name = test | ||
description = Description of package | ||
url = https://github.com/YetAnotherPackageInstaller/YAPI | ||
class = ignore | ||
|
||
[Common] | ||
dekstop_entry = ignore | ||
installed = ignore | ||
cache = ignore | ||
|
||
[Script] | ||
download = echo "Download section test" | ||
before_install = echo "Before install section test" | ||
install = echo "Install section test" | ||
after_install = echo "After install section test" | ||
unistall = echo "Unistall section test" | ||
desktop_entry = echo "Desktop_entry section test" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[DEFAULT] | ||
name = testnotignore | ||
description = Description of package | ||
url = https://github.com/YetAnotherPackageInstaller/YAPI | ||
class = testnotignore | ||
|
||
[Common] | ||
dekstop_entry = ignore | ||
installed = ignore | ||
cache = ignore | ||
|
||
[Script] | ||
download = echo "Download section test" | ||
before_install = echo "Before install section test" | ||
install = echo "Install section test" | ||
after_install = echo "After install section test" | ||
unistall = echo "Unistall section test" | ||
desktop_entry = echo "Desktop_entry section test" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[DEFAULT] | ||
name = tpatataest | ||
description = Description of package | ||
url = https://github.com/YetAnotherPackageInstaller/YAPI | ||
class = isdasdadsgnore | ||
|
||
[Common] | ||
dekstop_entry = ignore | ||
installed = ignore | ||
cache = ignore | ||
|
||
[Script] | ||
download = echo "Download section test" | ||
before_install = echo "Before install section test" | ||
install = echo "Install section test" | ||
after_install = echo "After install section test" | ||
unistall = echo "Unistall section test" | ||
desktop_entry = echo "Desktop_entry section test" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import subprocess | ||
import glob | ||
from configparser import ConfigParser | ||
from modules.configuration.config_extractor import get_configuration | ||
import os | ||
|
||
config = get_configuration() | ||
yapi_script = ConfigParser() | ||
list_script = list() | ||
directory = (str)(config["PACKAGES"]["packages_path"]) | ||
os.chdir(directory) | ||
for file in glob.glob("*"+".yp"): | ||
yapi_script.read(file) | ||
if yapi_script["DEFAULT"]["class"] != "ignore": | ||
list_script.append((str)(file)) | ||
print("{} - {}".format(len(list_script), | ||
yapi_script["DEFAULT"]["name"])) | ||
else: | ||
print("File {} ignore!".format(yapi_script["DEFAULT"]["name"])) | ||
print(list_script) | ||
choose = input("Put number here -> ") | ||
yapi_script.read(list_script[(int)(choose)-1]) | ||
output = subprocess.call( | ||
yapi_script["Script"]["install"], shell=True, stderr=subprocess.STDOUT) | ||
if output == 0: | ||
print("ok") | ||
else: | ||
print("not ok") |