mirror of
https://github.com/DJSundog/NopSCADlib.git
synced 2024-11-23 07:13:51 -05:00
Now shows what changed to trigger an openscad invocation in cyan.
This commit is contained in:
parent
26f1338ca2
commit
4f9729cf86
@ -18,6 +18,7 @@
|
|||||||
#
|
#
|
||||||
import os
|
import os
|
||||||
from set_config import source_dir
|
from set_config import source_dir
|
||||||
|
from colorama import Fore
|
||||||
|
|
||||||
def mtime(file):
|
def mtime(file):
|
||||||
if os.path.isfile(file):
|
if os.path.isfile(file):
|
||||||
@ -41,13 +42,13 @@ def read_deps(dname):
|
|||||||
def check_deps(target, dname):
|
def check_deps(target, dname):
|
||||||
target_mtime = mtime(target)
|
target_mtime = mtime(target)
|
||||||
if not target_mtime:
|
if not target_mtime:
|
||||||
return target + " missing"
|
return Fore.CYAN + target + " missing" + Fore.WHITE
|
||||||
if not os.path.isfile(dname):
|
if not os.path.isfile(dname):
|
||||||
return "no deps"
|
return Fore.CYAN + "no deps" + Fore.WHITE
|
||||||
deps = read_deps(dname)
|
deps = read_deps(dname)
|
||||||
for dep in deps:
|
for dep in deps:
|
||||||
if mtime(dep) > target_mtime:
|
if mtime(dep) > target_mtime:
|
||||||
return dep + ' changed'
|
return Fore.CYAN + dep + ' changed' + Fore.WHITE
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def source_dirs(bom_dir):
|
def source_dirs(bom_dir):
|
||||||
|
@ -31,6 +31,7 @@ from deps import *
|
|||||||
from tmpdir import *
|
from tmpdir import *
|
||||||
import json
|
import json
|
||||||
import shutil
|
import shutil
|
||||||
|
from colorama import Fore, init
|
||||||
|
|
||||||
def bom_to_parts(bom_dir, part_type, assembly = None):
|
def bom_to_parts(bom_dir, part_type, assembly = None):
|
||||||
#
|
#
|
||||||
@ -130,7 +131,7 @@ def make_parts(target, part_type, parts = None):
|
|||||||
changed = check_deps(part_file, dname)
|
changed = check_deps(part_file, dname)
|
||||||
changed = times.check_have_time(changed, part)
|
changed = times.check_have_time(changed, part)
|
||||||
if part_type == 'stl' and not changed and not part in bounds_map:
|
if part_type == 'stl' and not changed and not part in bounds_map:
|
||||||
changed = "No bounds"
|
changed = Fore.CYAN + "No bounds" + Fore.WHITE
|
||||||
if changed:
|
if changed:
|
||||||
print(changed)
|
print(changed)
|
||||||
#
|
#
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
# Set command line options from enviroment variables and check if they have changed
|
# Set command line options from enviroment variables and check if they have changed
|
||||||
|
|
||||||
import json, os, deps
|
import json, os, deps
|
||||||
|
from colorama import Fore, init
|
||||||
|
|
||||||
def check_options(dir = '.'):
|
def check_options(dir = '.'):
|
||||||
global options, options_mtime
|
global options, options_mtime
|
||||||
@ -37,7 +38,7 @@ def check_options(dir = '.'):
|
|||||||
|
|
||||||
def have_changed(changed, target):
|
def have_changed(changed, target):
|
||||||
if not changed and deps.mtime(target) < options_mtime:
|
if not changed and deps.mtime(target) < options_mtime:
|
||||||
return "command line options changed"
|
return Fore.CYAN + "command line options changed" + Fore.WHITE
|
||||||
return changed
|
return changed
|
||||||
|
|
||||||
def list():
|
def list():
|
||||||
|
@ -44,7 +44,7 @@ def got_time(name):
|
|||||||
|
|
||||||
def check_have_time(changed, name):
|
def check_have_time(changed, name):
|
||||||
if not changed and not got_time(name):
|
if not changed and not got_time(name):
|
||||||
changed = "no previous time"
|
changed = Fore.CYAN + "no previous time" + Fore.WHITE
|
||||||
return changed
|
return changed
|
||||||
|
|
||||||
def add_time(name, start):
|
def add_time(name, start):
|
||||||
|
Loading…
Reference in New Issue
Block a user