9. Moduli pyArchInit: Classi e Funzioni¶
Importante
In questa sezione si descivono le funzioni e alcune delle classi presenti in pyarchinit che possano aiutare allo sviluppo e implementazione del codice.
9.1. pyarchinit OS utility¶
Nota
Questa classe presenta alcune funzioni per copiare immagini, file e creare cartelle durante l’installazione del plugin
- class Pyarchinit_OS_Utility[sorgente]¶
Pyarchinit_OS_Utility
- static checkGraphvizInstallation()[sorgente]¶
Return True if Graphviz is installed
- static checkPostgresInstallation()[sorgente]¶
Return True if Postgres is installed
- copy_file(f, d)[sorgente]¶
Copy file
- Parametri:
str –
file path
str –
destination file
- create_dir(d)[sorgente]¶
Create directory
:param str - path directory
- static isMac()[sorgente]¶
Return True if platform is mac
- static isWindows()[sorgente]¶
Return True if platform is Windows
9.2. pyarchinit_utility¶
Nota
Questa classe presenta funzioni utili per aggiungere elementi ad un dizionario, contare elementi in una lista, cercare liste in un dizionario, indicizzare una colonna in una lista convertire tuple in liste.
- class Utility[sorgente]¶
- add_item_to_dict(d, i)[sorgente]¶
receive a dict and a list containt tuple with key,value and add them to dict
- count_list_eq_v(l, v)[sorgente]¶
take a list and a value. If the number of occurens of a items inside the list is equal to v value, put the singol value into list_res as a list. Return a list of lists
- find_list_in_dict(d)[sorgente]¶
recives a dict and if contains a list of lists and delete the item from the dict. Return a tuple containin the new dict and a list of tuples wich contain the keys and the values
- list_col_index_value(v1, v2)[sorgente]¶
return two lists into one tupla, takin” two list with same lenght and lookin for the occurrences. for every occurrences between v_1 and v_2 the v_2 value it’s charged into mod_value and its position in list it’s put into list_index.
- list_tup_2_list(l)[sorgente]¶
take a list of tuples ad return a list of lists
- pos_none_in_list(l)[sorgente]¶
take a list of values and return the position number of the values equal to “None”
- select_in_list(l, p)[sorgente]¶
take a list of lists or value and return the in a list of lists the value taken by the value of p.
- tup_2_list(t, s='', i=0)[sorgente]¶
take a tuple of strings, and return a list of lists of the values. if s is set, add the value to the strings. If i is set return only the value in the i position
- tup_2_list_II(l)[sorgente]¶
take a list of tuples ad return a list of lists
- tup_2_list_III(l)[sorgente]¶
take a list of tuples ad return a list of values
9.3. pyarchinit installation folder¶
Nota
Questa classe presenta due funzioni per installare nel percorso del tuo utente i file di configurazione e le cartelle
- class pyarchinit_Folder_installation[sorgente]¶
- installConfigFile(path)[sorgente]¶
Installa la configurazione file
- install_dir()[sorgente]¶
Funzione per installare la directory pyarchinit nel tuo utente