Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gerion Entrup
brainzfs
Commits
7de91390
Commit
7de91390
authored
Sep 26, 2016
by
Gerion Entrup
Browse files
create scripts folder
For testing scripts etc. They might not work.
parent
1bba597d
Changes
2
Hide whitespace changes
Inline
Side-by-side
foo.py
→
scripts/
foo.py
View file @
7de91390
File moved
scripts/get_database.py
0 → 100755
View file @
7de91390
#!/usr/bin/env python3
from
mbdata.models
import
Track
from
sqlalchemy.sql
import
select
import
timeit
import
sys
import
os
import
inspect
currentdir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
inspect
.
getfile
(
inspect
.
currentframe
())))
parentdir
=
os
.
path
.
dirname
(
currentdir
)
sys
.
path
.
insert
(
0
,
parentdir
)
from
brainzfs
import
_init_database
dbfile
=
sys
.
argv
[
1
]
if
len
(
sys
.
argv
)
>
1
else
'music.db'
session
=
_init_database
(
dbfile
)
def
test_all_query
():
global
session
return
session
.
execute
(
select
([
Track
.
name
]))
def
test_first_query
():
global
session
return
session
.
execute
(
select
([
Track
.
name
])).
first
()
# timeit.repeat(
print
(
test_all_query
())
print
(
"---------------------"
)
print
(
test_first_query
())
Write
Preview
Supports
Markdown
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