Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
migration_scripts
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
serpucga
migration_scripts
Commits
8d7eb4a2
Commit
8d7eb4a2
authored
Jul 24, 2019
by
serpucga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Beeps substituted by synth voice, which is c00ler and more explicit about what happened
parent
d3ed1927
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
pymongoexport_csv.py
pymongoexport_csv.py
+5
-7
No files found.
pymongoexport_csv.py
View file @
8d7eb4a2
...
@@ -35,8 +35,6 @@ else:
...
@@ -35,8 +35,6 @@ else:
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
# Initialize some variables
# Initialize some variables
duration
=
1
freq
=
440
script_dir
=
os
.
path
.
dirname
(
__file__
)
script_dir
=
os
.
path
.
dirname
(
__file__
)
output_dir
=
os
.
path
.
join
(
script_dir
,
"pymongodump"
,
args
.
database
)
output_dir
=
os
.
path
.
join
(
script_dir
,
"pymongodump"
,
args
.
database
)
header_file
=
os
.
path
.
join
(
script_dir
,
"config"
,
"header.txt"
)
header_file
=
os
.
path
.
join
(
script_dir
,
"config"
,
"header.txt"
)
...
@@ -100,7 +98,7 @@ try:
...
@@ -100,7 +98,7 @@ try:
writer_worker
.
start
()
writer_worker
.
start
()
except
Exception
:
except
Exception
:
logger
.
error
(
"There was a failure in the filesystem writer"
,
exc_info
=
True
)
logger
.
error
(
"There was a failure in the filesystem writer"
,
exc_info
=
True
)
os
.
system
(
"
play -nq -t alsa synth {} sine {}"
.
format
(
duration
,
freq
)
)
os
.
system
(
"
spd-say 'Something really bad happened!'"
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
# Launch pool of workers to perform the format conversion
# Launch pool of workers to perform the format conversion
...
@@ -110,12 +108,12 @@ try:
...
@@ -110,12 +108,12 @@ try:
except
utils
.
ExceptionAtPage
as
exc
:
except
utils
.
ExceptionAtPage
as
exc
:
logger
.
error
(
"Error detected at page {}"
.
format
(
exc
.
error_page
))
logger
.
error
(
"Error detected at page {}"
.
format
(
exc
.
error_page
))
task_queue
.
put
((
exc
.
error_page
,
"ERROR"
))
task_queue
.
put
((
exc
.
error_page
,
"ERROR"
))
os
.
system
(
"
play -nq -t alsa synth {} sine {}"
.
format
(
duration
,
freq
)
)
os
.
system
(
"
spd-say 'Something really bad happened!'"
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
except
(
Exception
,
KeyboardInterrupt
):
except
(
Exception
,
KeyboardInterrupt
):
logger
.
error
(
"Error detected"
,
exc_info
=
True
)
logger
.
error
(
"Error detected"
,
exc_info
=
True
)
task_queue
.
put
((
-
2
,
"ERROR"
))
task_queue
.
put
((
-
2
,
"ERROR"
))
os
.
system
(
"
play -nq -t alsa synth {} sine {}"
.
format
(
duration
,
freq
)
)
os
.
system
(
"
spd-say 'Something really bad happened!'"
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
task_queue
.
put
((
-
1
,
"END"
))
task_queue
.
put
((
-
1
,
"END"
))
...
@@ -129,7 +127,7 @@ try:
...
@@ -129,7 +127,7 @@ try:
except
(
Exception
,
KeyboardInterrupt
):
except
(
Exception
,
KeyboardInterrupt
):
logger
.
error
(
"The collection was converted correctly to CSV, but something"
logger
.
error
(
"The collection was converted correctly to CSV, but something"
+
" failed when generating the metadata file"
,
exc_info
=
True
)
+
" failed when generating the metadata file"
,
exc_info
=
True
)
os
.
system
(
"
play -nq -t alsa synth {} sine {}"
.
format
(
duration
,
freq
)
)
os
.
system
(
"
spd-say 'Something really bad happened!'"
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
if
globals
.
timing
:
if
globals
.
timing
:
logger
.
critical
(
logger
.
critical
(
...
@@ -139,5 +137,5 @@ if globals.timing:
...
@@ -139,5 +137,5 @@ if globals.timing:
"Total execution time: {}s"
"Total execution time: {}s"
.
format
(
time
.
time
()
-
time0
))
.
format
(
time
.
time
()
-
time0
))
os
.
system
(
"play -nq -t alsa synth {} sine {}"
.
format
(
duration
,
freq
)
)
os
.
system
(
'spd-say "Conversion completed successfully!"'
)
logger
.
info
(
"Conversion completed successfully!!"
)
logger
.
info
(
"Conversion completed successfully!!"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment