Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hdd29-CS265-sp19
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hdd29
hdd29-CS265-sp19
Commits
7635929f
Commit
7635929f
authored
6 years ago
by
hdd29
Browse files
Options
Downloads
Patches
Plain Diff
parsing README (no check for file type), iterate through all dirs
parent
59b14caf
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
assn2/dropXml.py
+30
-0
30 additions, 0 deletions
assn2/dropXml.py
assn2/parseRM
+23
-0
23 additions, 0 deletions
assn2/parseRM
with
53 additions
and
0 deletions
assn2/dropXml.py
0 → 100644
+
30
−
0
View file @
7635929f
#!/usr/bin/env python 3
import
sys
import
os
top
=
sys
.
argv
[
1
]
IND
=
'
'
os
.
chdir
(
top
)
rootPath
=
os
.
getcwd
()
for
root
,
dirs
,
files
in
os
.
walk
(
top
):
os
.
chdir
(
root
)
currentDir
=
os
.
getcwd
()
exists
=
os
.
path
.
isfile
(
str
(
currentDir
)
+
'
/README
'
)
if
exists
:
print
(
'
Found it!
'
)
else
:
print
(
'
Uh uh, no REDME for you!
'
)
os
.
chdir
(
rootPath
)
def
createDirXML
():
dirXML
=
open
(
'
dir.xml
'
,
'
w+
'
)
dirXML
.
close
()
with
open
(
'
dir.xml
'
,
'
a
'
)
as
dirXML
:
dirXML
.
write
(
'
<?xml version=
"
1.0
"
encoding=
"
ISO-8859-1
"
?>
\n
<direntry>
'
)
#if exist README in that folder
This diff is collapsed.
Click to expand it.
assn2/parseRM
0 → 100644
+
23
−
0
View file @
7635929f
#!/usr/bin/env python3
RM
=
open
(
'
README
'
,
'
r
'
)
line_list
=
RM
.
readlines
()
RM
.
close
()
for
l
in
line_list
:
w
=
l
.
split
(
'
:
'
)
if
str
(
w
[
0
])
==
'
index
'
:
last
=
w
[
-
1
].
strip
(
'
\n
'
)
index
=
w
[
1
:(
len
(
w
)
-
1
)]
index
.
append
(
last
)
elif
str
(
w
[
0
])
==
'
required
'
:
w
[
-
1
].
strip
(
'
\n
'
)
last
=
w
[
-
1
].
strip
(
'
\n
'
)
required
=
w
[
1
:(
len
(
w
)
-
1
)]
required
.
append
(
last
)
print
(
'
required list is
'
+
str
(
required
))
print
(
'
index list is
'
+
str
(
index
))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment