Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/acdh-oeaw/arche-gui
Browse files Browse the repository at this point in the history
  • Loading branch information
nczirjak-acdh committed Dec 7, 2021
2 parents 11effcd + 3559564 commit 62187f0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,37 @@
import argparse
import os
import pip
import re
import subprocess
import sys

lacking = []
try:
import requests
except ModuleNotFoundError:
print("Your Python installation lacks the 'requests' library.\nYou should be able to install it with `pip install requests` or from your operating system package (e.g. python3-requests under debian/ubuntu)")
quit()
lacking.append('requests')
try:
from rdflib import Graph
from rdflib.term import URIRef
from rdflib import Graph, URIRef
except ModuleNotFoundError:
print("Your Python installation lacks the RDFlib library.\nYou should be able to install it with `pip install rdflib` or from your operating system packages (e.g. python3-rdflib under debian/ubuntu)")
quit()
lacking.append('rdflib')

if len(lacking) > 0:
choice = ''
while choice != '1' and choice != '2':
print("\nYour python installation lacks some dependencies (" + ", ".join(lacking) + ").")
print("You can install them on your own or we can try to install them for you. which option do you prefer?\n")
print("1. Install manually")
print("2. Try to install automatically")
choice = input().strip()
print("\n")
if choice == '1':
for i in lacking:
print("You are missing the '%s' library. You should be able to install it with `pip install %s` or from your operating system package (e.g. python3-%s under debian/ubuntu or python-%s under fedora/redhat/centos)\n" % (i, i, i, i))
else:
for i in lacking:
subprocess.check_call([sys.executable, '-m', 'pip', 'install', i])
print("\nInstallation successful - please run the script again")
quit()

args = argparse.ArgumentParser()
args.add_argument('--user', help='User name (for downloading restricted-access resources')
Expand Down
16 changes: 8 additions & 8 deletions src/Object/BreadCrumbObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(array $data)
* @return string
*/
public function getBreadCrumb(): string
{
{
$multiple = $this->checkMultipleBreadCrumb();

if (count($multiple) > 1) {
Expand Down Expand Up @@ -82,8 +82,8 @@ private function createSingleBreadcrumb()
* Create the string from the multiple breadcrumbs
* @param array $multiple
*/
private function createMultiBreadcrumb(array $multiple)
{
private function createMultiBreadcrumb(array $multiple)
{
foreach ($multiple as $m) {
$this->i = 0;
$this->str .= '<i class="material-icons breadcrumb-icon">label</i>';
Expand Down Expand Up @@ -114,11 +114,11 @@ private function buildTree(array $elements, $parentId = 0)
/**
* We have to reorder the actual roots by the avilable date
*/
private function reOrderBreadCrumbByDate(array $roots): array {
uasort($roots,function($a,$b){
return strcmp($a->avdate,$b->avdate);
});
private function reOrderBreadCrumbByDate(array $roots): array
{
uasort($roots, function ($a, $b) {
return strcmp($a->avdate, $b->avdate);
});
return $roots;
}

}

0 comments on commit 62187f0

Please sign in to comment.