@@ -219,7 +219,7 @@ def elimina_pg_schema(versione):
219
219
return None
220
220
221
221
def crea_nuovo_repository (repo_name ,bare = True ,readonly_workingcopy = None ):
222
- repo_path = os .path .join (settings .KART_REPO ,repo_name )
222
+ repo_path = os .path .join (settings .DJAKART_REPO ,repo_name )
223
223
cmds = ["init" , repo_path ]
224
224
if readonly_workingcopy :
225
225
crea_pg_schema (readonly_workingcopy , readonly = True )
@@ -240,14 +240,14 @@ def crea_nuovo_repository(repo_name,bare=True,readonly_workingcopy=None):
240
240
241
241
242
242
def get_config (v ,key ):
243
- v_path = os .path .join (settings .KART_REPO ,v )
243
+ v_path = os .path .join (settings .DJAKART_REPO ,v )
244
244
res = executeCmd (["--repo" ,v_path ,"config" , "--get" , 'key' ])
245
245
return res
246
246
247
247
248
248
def crea_nuova_versione (nuova_versione ,base ,tipo = "pg" ,riserva_id = 100 ):
249
- nuova_versione_path = os .path .join (settings .KART_REPO ,nuova_versione )
250
- master_path = os .path .join (settings .KART_REPO ,base )
249
+ nuova_versione_path = os .path .join (settings .DJAKART_REPO ,nuova_versione )
250
+ master_path = os .path .join (settings .DJAKART_REPO ,base )
251
251
if tipo == 'pg' :
252
252
crea_pg_schema (nuova_versione )
253
253
uri = get_pg_uri (nuova_versione )
@@ -278,7 +278,7 @@ def get_pg_uri(v):
278
278
279
279
280
280
def create_workingcopy (v , uri = None , force = False ):
281
- v_path = os .path .join (settings .KART_REPO ,v )
281
+ v_path = os .path .join (settings .DJAKART_REPO ,v )
282
282
cmds = ["--repo" ,v_path ,"create-workingcopy" ]
283
283
if force :
284
284
cmds .append ('--delete-existing' )
@@ -290,7 +290,7 @@ def create_workingcopy(v, uri=None, force=False):
290
290
291
291
292
292
def merge_versione (versione , abort = False , confirm = False ):
293
- versione_path = os .path .join (settings .KART_REPO ,versione )
293
+ versione_path = os .path .join (settings .DJAKART_REPO ,versione )
294
294
if os .path .exists (versione_path ):
295
295
#clone master
296
296
#commit_versione(versione, '"merge %s"' % versione)
@@ -315,13 +315,13 @@ def merge_versione(versione, abort=False, confirm=False):
315
315
316
316
317
317
def clone_versione (versione , target ):
318
- versione_path = os .path .join (settings .KART_REPO ,versione )
318
+ versione_path = os .path .join (settings .DJAKART_REPO ,versione )
319
319
if os .path .exists (versione_path ):
320
320
clone_cmd = executeCmd (["clone" , versione_path , target ])
321
321
322
322
323
323
def config_user_versione (versione , username , useremail ):
324
- versione_path = os .path .join (settings .KART_REPO ,versione )
324
+ versione_path = os .path .join (settings .DJAKART_REPO ,versione )
325
325
if os .path .exists (versione_path ):
326
326
setuser = kart_cmd (versione_path , ["config" , "user.name" , username ])
327
327
setmail = kart_cmd (versione_path , ["config" , "user.email" , useremail ])
@@ -343,21 +343,21 @@ def aggiorna_riferimenti(versione):
343
343
344
344
345
345
def pull_versione (versione ):
346
- versione_path = os .path .join (settings .KART_REPO ,versione )
346
+ versione_path = os .path .join (settings .DJAKART_REPO ,versione )
347
347
#master_path = get_remote(versione)
348
348
if os .path .exists (versione_path ):
349
349
push_cmd = executeCmd (["--repo" , versione_path , "pull" , "origin" ])
350
350
351
351
352
352
def kart_cmd (versione ,args ):
353
- versione_path = os .path .join (settings .KART_REPO ,versione )
353
+ versione_path = os .path .join (settings .DJAKART_REPO ,versione )
354
354
if os .path .exists (versione_path ):
355
355
kart_cmd = executeCmd (["--repo" , versione_path ] + args )
356
356
return kart_cmd
357
357
358
358
359
359
def importa_dataset (versione ,ds_path ,max_extent = None ):
360
- versione_path = os .path .join (settings .KART_REPO , versione )
360
+ versione_path = os .path .join (settings .DJAKART_REPO , versione )
361
361
print ("versione_path" , versione_path )
362
362
if os .path .exists (versione_path ):
363
363
if not max_extent :
@@ -392,14 +392,14 @@ def importa_dataset(versione,ds_path,max_extent=None):
392
392
393
393
394
394
def commit_versione (versione , messaggio ):
395
- versione_path = os .path .join (settings .KART_REPO ,versione )
395
+ versione_path = os .path .join (settings .DJAKART_REPO ,versione )
396
396
if os .path .exists (versione_path ):
397
397
#recover_uncommitted_nulls(versione) #necessario per evitare successive exceptions di kart
398
398
commit_cmd = executeCmd (["--repo" , versione_path , "commit" , "-m" , messaggio ])
399
399
400
400
401
401
def elimina_versione (canc_versione ):
402
- canc_versione_path = os .path .join (settings .KART_REPO ,canc_versione )
402
+ canc_versione_path = os .path .join (settings .DJAKART_REPO ,canc_versione )
403
403
pgschema = elimina_pg_schema (canc_versione )
404
404
if os .path .exists (canc_versione_path ):
405
405
#clone master
@@ -410,7 +410,7 @@ def elimina_versione(canc_versione):
410
410
411
411
412
412
def undo_commit_versione (versione , force = None ):
413
- versione_path = os .path .join (settings .KART_REPO ,versione )
413
+ versione_path = os .path .join (settings .DJAKART_REPO ,versione )
414
414
if os .path .exists (versione_path ):
415
415
jlog = log_versione (versione ,jsonoutput = True )
416
416
hash = jlog [1 ]["commit" ]
@@ -422,14 +422,14 @@ def undo_commit_versione(versione, force=None):
422
422
423
423
424
424
def restore_versione (versione ):
425
- versione_path = os .path .join (settings .KART_REPO ,versione )
425
+ versione_path = os .path .join (settings .DJAKART_REPO ,versione )
426
426
if os .path .exists (versione_path ):
427
427
cmd = executeCmd (["--repo" ,versione_path ,"restore" ])
428
428
return cmd
429
429
430
430
431
431
def status_versione (versione , as_json = False ):
432
- versione_path = os .path .join (settings .KART_REPO ,versione )
432
+ versione_path = os .path .join (settings .DJAKART_REPO ,versione )
433
433
if os .path .exists (versione_path ):
434
434
try :
435
435
params = ["--repo" ,versione_path ,"status" ]
@@ -444,15 +444,15 @@ def status_versione(versione, as_json=False):
444
444
445
445
446
446
def show_versione (versione , jsonoutput = False ):
447
- versione_path = os .path .join (settings .KART_REPO ,versione )
447
+ versione_path = os .path .join (settings .DJAKART_REPO ,versione )
448
448
if os .path .exists (versione_path ):
449
449
cmd = executeCmd (["--repo" ,versione_path ,"show" ], jsonoutput = jsonoutput )
450
450
merged_list = cmd .replace ("* " ,"" ).replace (" " ,"" ).split ("\n " )
451
451
return merged_list
452
452
453
453
454
454
def merged_list_versione (versione ):
455
- versione_path = os .path .join (settings .KART_REPO ,versione )
455
+ versione_path = os .path .join (settings .DJAKART_REPO ,versione )
456
456
if os .path .exists (versione_path ):
457
457
try :
458
458
cmd = executeCmd (["--repo" ,versione_path ,"branch" ,"--merged" ], jsonoutput = False )
@@ -463,7 +463,7 @@ def merged_list_versione(versione):
463
463
464
464
465
465
def log_versione (versione , jsonoutput = False ):
466
- versione_path = os .path .join (settings .KART_REPO ,versione )
466
+ versione_path = os .path .join (settings .DJAKART_REPO ,versione )
467
467
if os .path .exists (versione_path ):
468
468
cmd = executeCmd (["--repo" ,versione_path ,"log" ], jsonoutput = jsonoutput )
469
469
return cmd
@@ -477,7 +477,7 @@ def _diff_view(crs,extent):
477
477
478
478
479
479
def genera_diff_versione (versione , hash = None , prev = None , crs = SRID , extent = [0 ,0 ,0 ,0 ], format = 'html' ):
480
- versione_path = os .path .join (settings .KART_REPO ,versione )
480
+ versione_path = os .path .join (settings .DJAKART_REPO ,versione )
481
481
if os .path .exists (versione_path ):
482
482
jlog = log_versione (versione ,jsonoutput = True )
483
483
commit = list (filter (lambda target : target ["commit" ] == hash , jlog ))
@@ -496,7 +496,7 @@ def genera_diff_versione(versione, hash=None, prev=None, crs=SRID, extent=[0,0,0
496
496
497
497
498
498
def conflitti_versione (versione , crs = SRID ):
499
- versione_path = os .path .join (settings .KART_REPO ,versione )
499
+ versione_path = os .path .join (settings .DJAKART_REPO ,versione )
500
500
if os .path .exists (versione_path ):
501
501
conflicts_dir = os .path .join (versione_path ,'conflicts' )
502
502
cmd = executeCmd (["--repo" ,versione_path ,"conflicts" , "--crs" , crs ,"-o" ,"geojson" ,"--output" ,conflicts_dir ])
@@ -514,14 +514,14 @@ def conflitti_versione(versione, crs=SRID):
514
514
515
515
516
516
def resolve_conflitto (versione , tag_conflitto , risoluzione ):
517
- versione_path = os .path .join (settings .KART_REPO ,versione )
517
+ versione_path = os .path .join (settings .DJAKART_REPO ,versione )
518
518
if os .path .exists (versione_path ):
519
519
cmd = executeCmd (["--repo" ,versione_path ,"resolve" ,"--with" ,risoluzione ,tag_conflitto ])
520
520
return cmd
521
521
522
522
523
523
def get_remote (versione , remote = "origin" , method = 'push' ):
524
- versione_path = os .path .join (settings .KART_REPO ,versione )
524
+ versione_path = os .path .join (settings .DJAKART_REPO ,versione )
525
525
if os .path .exists (versione_path ):
526
526
cmd = executeCmd (["--repo" ,versione_path ,"remote" ,"-v" ])
527
527
if cmd :
@@ -531,7 +531,7 @@ def get_remote(versione, remote="origin", method='push'):
531
531
532
532
533
533
def list_versioned_tables (versione ):
534
- versione_path = os .path .join (settings .KART_REPO ,versione .replace ("_pub" ,"" ))
534
+ versione_path = os .path .join (settings .DJAKART_REPO ,versione .replace ("_pub" ,"" ))
535
535
if os .path .exists (versione_path ):
536
536
cmd = executeCmd (["--repo" ,versione_path ,"data" ,"ls" ])
537
537
ds_list = cmd .split ("\n " )
@@ -544,7 +544,7 @@ def prevent_conflicts_on_ids(versione):
544
544
stepoverseq = ""
545
545
546
546
def geo_tables (versione ):
547
- versione_path = os .path .join (settings .KART_REPO ,versione )
547
+ versione_path = os .path .join (settings .DJAKART_REPO ,versione )
548
548
if os .path .exists (versione_path ):
549
549
geom_tables = []
550
550
for tab in list_versioned_tables (versione ):
@@ -559,7 +559,7 @@ def geo_tables(versione):
559
559
560
560
561
561
def get_metadata (versione ,tab ):
562
- versione_path = os .path .join (settings .KART_REPO ,versione )
562
+ versione_path = os .path .join (settings .DJAKART_REPO ,versione )
563
563
if os .path .exists (versione_path ):
564
564
try :
565
565
cmd = executeCmd (["--repo" ,versione_path ,"meta" ,"get" ,tab ,"-o" ,"json" ])
@@ -569,7 +569,7 @@ def get_metadata(versione,tab):
569
569
570
570
571
571
def get_schema (versione ,tab ,** kwargs ):
572
- versione_path = os .path .join (settings .KART_REPO ,versione )
572
+ versione_path = os .path .join (settings .DJAKART_REPO ,versione )
573
573
if os .path .exists (versione_path ):
574
574
metadata = get_metadata (versione ,tab )
575
575
schema = {}
@@ -584,7 +584,7 @@ def get_schema(versione,tab,**kwargs):
584
584
585
585
586
586
def recover_uncommitted_nulls (versione ):
587
- versione_path = os .path .join (settings .KART_REPO ,versione )
587
+ versione_path = os .path .join (settings .DJAKART_REPO ,versione )
588
588
if os .path .exists (versione_path ):
589
589
cmd = kart_cmd (versione ,['diff' ,'-o' ,'json' ])
590
590
uncommitted_diff = json .loads (cmd )
0 commit comments