4 import bp_config
as config
6 def progressBar(value, endvalue, docdb_id, bar_length=40):
7 percent =
float(value) / endvalue
8 arrow =
'=' *
int(
round(percent * bar_length)-1) +
'>' 9 spaces =
' ' * (bar_length - len(arrow))
11 sys.stdout.write(
"\rProgress: [\033[01;32m{0}\033[00m] {1}/{2} ({3}%) -- DocDB {4}".
format(arrow + spaces, value, endvalue,
int(
round(percent * 100)), docdb_id))
17 for root, dirs, files
in os.walk(dir):
19 if root.find(
'__MACOSX') > 0:
continue 24 if file.startswith(
'.'):
continue 27 if os.path.splitext(os.path.basename(file))[1][1:]
not in config.CAPTION_EXTS:
continue 28 ret.append(
'{}/{}'.
format(root, file)[2:])
32 if os.path.splitext(os.path.basename(file2))[0] != os.path.splitext(os.path.basename(file))[0]
or os.path.splitext(os.path.basename(file2))[1][1:]
not in config.PLOT_EXTS:
continue 34 ret.append(
'{}/{}'.
format(root, file2)[2:])
41 for root, dirs, files
in os.walk(dir):
43 if root.find(
'__MACOSX') > 0:
continue 48 if file.startswith(
'.'):
continue 51 if os.path.splitext(os.path.basename(file))[1][1:]
not in config.CAPTION_EXTS:
continue 52 ret.append(
'{}/{}'.
format(root, file)[2:])
59 for root, dirs, files
in os.walk(dir):
61 if root.find(
'__MACOSX') > 0:
continue 66 if file.startswith(
'.'):
continue 68 if os.path.splitext(os.path.basename(file))[0] != os.path.splitext(os.path.basename(cap))[0]
or os.path.splitext(os.path.basename(file))[1][1:]
not in config.PLOT_EXTS:
continue 70 ret.append(
'{}/{}'.
format(root, file)[2:])
def progressBar(value, endvalue, docdb_id, bar_length=40)
fvar< T > round(const fvar< T > &x)
def ListPlotsInDirForCaption(dir, cap)
def ListCaptionFilesInDir(dir)
std::string format(const int32_t &value, const int &ndigits=8)
def ListBlessedFilesInDir(dir)