Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
Flask_User_Reg
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Krish Moodbidri
Flask_User_Reg
Commits
7394d196
Commit
7394d196
authored
5 years ago
by
Mitchell Moore
Browse files
Options
Downloads
Patches
Plain Diff
Properly initiate while loop, include debug info
parent
356184e0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/__init__.py
+9
-4
9 additions, 4 deletions
app/__init__.py
with
9 additions
and
4 deletions
app/__init__.py
+
9
−
4
View file @
7394d196
...
...
@@ -36,20 +36,22 @@ class MyHandler(FileSystemEventHandler):
global
observing
# print(event.src_path + " modified.")
snap_after
=
dirsnapshot
.
DirectorySnapshot
(
"
flat_db
/
"
,
True
)
snap_after
=
dirsnapshot
.
DirectorySnapshot
(
"
/home/reggie/
flat_db
"
,
True
)
snap_diff
=
dirsnapshot
.
DirectorySnapshotDiff
(
snap_before
,
snap_after
)
try
:
if
(
"
flat_db/
"
+
time_stamp
+
"
.done
"
+
"
.txt
"
)
in
snap_diff
.
files_moved
[
0
]
:
if
(
"
/home/reggie/
flat_db/
"
+
time_stamp
+
"
.done
"
)
in
snap_diff
.
files_moved
:
observing
=
False
# print("YES!")
except
:
except
Exception
as
e
:
print
(
e
)
observing
=
False
pass
# print("Created: ", snap_diff.files_created)
# print("Deleted: ", snap_diff.files_deleted)
# print("Modified: ", snap_diff.files_modified)
#
print("Moved: ", snap_diff.files_moved)
print
(
"
Moved:
"
,
snap_diff
.
files_moved
)
def
on_created
(
self
,
event
):
...
...
@@ -90,6 +92,7 @@ def create_app(config_name):
global
return_url
global
snap_before
global
observing
print
(
username
,
fullname
,
return_url
,
file
=
sys
.
stdout
)
# Deliver arguments to script.
...
...
@@ -112,6 +115,8 @@ def create_app(config_name):
observer
.
schedule
(
event_handler
,
path
=
'
/home/reggie/flat_db
'
,
recursive
=
True
)
observer
.
start
()
observing
=
True
file
=
open
(
complete_file_name
,
"
w
"
)
file
.
write
(
"
Hey
"
)
...
...
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