Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sqlGit
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Muller Guenael
sqlGit
Commits
501704c8
Commit
501704c8
authored
Dec 23, 2015
by
Inkhey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better generator for file
parent
549f22af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
13 deletions
+8
-13
sqlGit.py
sqlGit.py
+8
-13
No files found.
sqlGit.py
View file @
501704c8
...
@@ -115,20 +115,19 @@ class sqlGit(object):
...
@@ -115,20 +115,19 @@ class sqlGit(object):
data
=
line
.
split
(
'[;;|\/|;;]'
)
data
=
line
.
split
(
'[;;|\/|;;]'
)
yield
(
data
)
yield
(
data
)
def
_gInsertFile
(
self
,
depth
,
mdepth
):
def
_gInsertFile
(
self
,
depth
):
for
root
,
dirs
,
files
in
filtered_walk
(
"."
,
depth
=
depth
):
for
root
,
dirs
,
files
in
filtered_walk
(
"."
,
depth
=
depth
):
for
fn
in
files
:
for
fn
in
files
:
path
=
os
.
path
.
join
(
root
,
fn
)
path
=
os
.
path
.
join
(
root
,
fn
)
size
=
os
.
path
.
getsize
(
path
)
size
=
os
.
path
.
getsize
(
path
)
data
=
(
fn
,
size
,
root
)
data
=
(
fn
,
size
,
root
)
yield
(
data
)
yield
(
data
)
for
root
,
dirs
,
files
in
filtered_walk
(
"."
,
depth
=
depth
,
if
(
root
.
count
(
"/"
)
==
depth
):
min_depth
=
mdepth
):
for
d
in
dirs
:
for
d
in
dirs
:
path
=
os
.
path
.
join
(
root
,
d
)
path
=
os
.
path
.
join
(
root
,
d
)
size
=
self
.
_get_size_dir
(
path
)
size
=
self
.
_get_size_dir
(
path
)
data
=
(
d
,
size
,
root
)
data
=
(
d
,
size
,
root
)
yield
(
data
)
yield
(
data
)
def
_gInsertLFC
(
self
,
l
):
def
_gInsertLFC
(
self
,
l
):
...
@@ -197,13 +196,9 @@ class sqlGit(object):
...
@@ -197,13 +196,9 @@ class sqlGit(object):
def
insert_file
(
self
,
depth
):
def
insert_file
(
self
,
depth
):
''' insert file data into file table, depth define how precise
''' insert file data into file table, depth define how precise
file data will be.'''
file data will be.'''
if
depth
>
0
:
mdepth
=
depth
else
:
mdepth
=
None
c
=
self
.
conn
.
cursor
()
c
=
self
.
conn
.
cursor
()
# TODO : gérer profondeur et ignorer fichier dans .git ?
# TODO : gérer profondeur et ignorer fichier dans .git ?
g
=
self
.
_gInsertFile
(
depth
,
mdepth
)
g
=
self
.
_gInsertFile
(
depth
)
c
.
executemany
(
c
.
executemany
(
'''INSERT INTO file(name,size,dir)
'''INSERT INTO file(name,size,dir)
values (?,?,?);'''
,
g
)
values (?,?,?);'''
,
g
)
...
...
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