20250119.1737294734
This commit is contained in:
parent
8c4e07134c
commit
177ed7f0f1
1 changed files with 6 additions and 4 deletions
|
@ -471,14 +471,15 @@ def insert():
|
||||||
print("There is no text")
|
print("There is no text")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
try:
|
try:
|
||||||
result = subprocess.run(
|
subprocess.run(
|
||||||
f'printf "%s %s" "{convert_diary_date(datenow_timestamp)}" {content} | jrnl {diary_name}',
|
f'printf "%s %s" "{convert_diary_date(datenow_timestamp)}" {content} | jrnl {diary_name}',
|
||||||
shell=True,
|
shell=True,
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
text=True,
|
text=True,
|
||||||
check=True,
|
check=True,
|
||||||
)
|
)
|
||||||
print(result.stdout)
|
os.system("clear")
|
||||||
|
print("Record has been inserted.")
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
print(f"Error inserting single entry: {e.stderr}")
|
print(f"Error inserting single entry: {e.stderr}")
|
||||||
raise
|
raise
|
||||||
|
@ -497,14 +498,15 @@ def insert():
|
||||||
content = shlex.quote(file.read())
|
content = shlex.quote(file.read())
|
||||||
if hash != make_hash(temp_file_path):
|
if hash != make_hash(temp_file_path):
|
||||||
try:
|
try:
|
||||||
result = subprocess.run(
|
subprocess.run(
|
||||||
f'printf "%s %s" "{convert_diary_date(datenow_timestamp)}" {content} | jrnl {diary_name}',
|
f'printf "%s %s" "{convert_diary_date(datenow_timestamp)}" {content} | jrnl {diary_name}',
|
||||||
shell=True,
|
shell=True,
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
text=True,
|
text=True,
|
||||||
check=True,
|
check=True,
|
||||||
)
|
)
|
||||||
print(result.stdout)
|
os.system("clear")
|
||||||
|
print("Record has been inserted.")
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
print(
|
print(
|
||||||
f"Error during bulk import: {e.stderr}, file: {temp_file_path}"
|
f"Error during bulk import: {e.stderr}, file: {temp_file_path}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue