Merge lp:~diegosarmentero/ubuntuone-client/darwin2-fsevents into lp:ubuntuone-client
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Alejandro J. Cura on 2012-06-26 | ||||
| Approved revision: | 1268 | ||||
| Merged at revision: | 1267 | ||||
| Proposed branch: | lp:~diegosarmentero/ubuntuone-client/darwin2-fsevents | ||||
| Merge into: | lp:ubuntuone-client | ||||
| Prerequisite: | lp:~diegosarmentero/ubuntuone-client/darwin-fsevents-1 | ||||
| Diff against target: |
912 lines (+376/-280) 4 files modified
tests/platform/filesystem_notifications/test_windows.py (+3/-3) ubuntuone/platform/filesystem_notifications/__init__.py (+1/-0) ubuntuone/platform/filesystem_notifications/common.py (+64/-277) ubuntuone/platform/filesystem_notifications/windows.py (+308/-0) |
||||
| To merge this branch: | bzr merge lp:~diegosarmentero/ubuntuone-client/darwin2-fsevents | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Alejandro J. Cura (community) | 2012-06-21 | Approve on 2012-06-26 | |
| Manuel de la Peña (community) | Approve on 2012-06-25 | ||
|
Review via email:
|
|||
Commit Message
- Refactoring windows fsevents implementation, to be usable from the future darwin one (LP: #1013323).
- 1263. By Diego Sarmentero on 2012-06-22
-
Updating branch
| Diego Sarmentero (diegosarmentero) wrote : | # |
> The implementation in add_watches_
> windows, so it needs to be moved to windows.py
>
Moved to windows, we will need to implement later for darwin something here, but not just returning True as in windows.
> ---
>
> FILESYSTEM_
> filesystem_
>
This is not broken, the mask is assigned in windows.py, and for darwin i'm using it as None, so i can share more common code in common.py.
> ---
>
> All of this would break on darwin:
> is_valid_
> is_valid_os_path = None
> os_path = windowspath = None
>
> So everything under:
> elif sys.platform == "darwin":
>
> should come on a following branch.
>
> ---
>
> Please rename "reference" to something less vague, and move each definition to
> the platform specific files.
Done
| Alejandro J. Cura (alecu) wrote : | # |
> > FILESYSTEM_
> > filesystem_
> >
>
> This is not broken, the mask is assigned in windows.py, and for darwin i'm
> using it as None, so i can share more common code in common.py.
You are right! Sorry about that :P
| Alejandro J. Cura (alecu) wrote : | # |
This comment is *Very* specific to windows:
# On windows there is no need to add the watches to the ancestors
# so we will always return true. The reason for this is that the
# handles that we open stop the user from renaming the ancestors of
# the UDF, for a user to do that he has to unsync the udf first
This too:
For Windows:
Also, they must not be literal paths, that is the \\?\ prefix should not be
in the path.
Both should be in windows.py.
- 1264. By Diego Sarmentero on 2012-06-22
-
merge
- 1265. By Diego Sarmentero on 2012-06-22
-
updates
- 1266. By Diego Sarmentero on 2012-06-22
-
adding not implemented error
- 1267. By Diego Sarmentero on 2012-06-22
-
moving event codes to filesystem notification init
| Diego Sarmentero (diegosarmentero) wrote : | # |
Branch fixed.
I added the event codes in the filesystem_
Also i remove the if sys.platform == "win32": import decorators
on common, and in the future branch, when i add the darwin part, i'll make os_helper import the proper decorator based on the platform as it should be.
| Alejandro J. Cura (alecu) wrote : | # |
This will probably break on darwin, where fs paths are utf-8 bytes, so it should go from common.py to windows.py:
473 if not isinstance(path, unicode):
----
The comment that starts with:
# We are using this on windows and darwin.
# For windows the logic is as follow:
# ....
is still crap. The whole 9 lines of it, so it's not completely your fault, but it's crap.
Let's rewrite it with something simpler like this:
# We need to manually check if the path is a folder, because
# neither ReadDirectoryCh
Also the docstring in that function lies about "update the local subdir list".
---
- 1268. By Diego Sarmentero on 2012-06-26
-
fixing comment
| Diego Sarmentero (diegosarmentero) wrote : | # |
> This will probably break on darwin, where fs paths are utf-8 bytes, so it
> should go from common.py to windows.py:
>
> 473 if not isinstance(path, unicode):
>
> ----
>
> The comment that starts with:
> # We are using this on windows and darwin.
> # For windows the logic is as follow:
> # ....
>
> is still crap. The whole 9 lines of it, so it's not completely your fault, but
> it's crap.
> Let's rewrite it with something simpler like this:
>
> # We need to manually check if the path is a folder, because
> # neither ReadDirectoryCh
>
> Also the docstring in that function lies about "update the local subdir list".
>
> ---
The comment has been fixed, and the isinstance thing is fixed in the next branch which involves actually the darwin things as we talk.
| Alejandro J. Cura (alecu) wrote : | # |
Code looks fine. Ran tests on Precise and windows, and they all pass.


The implementation in add_watches_ to_udf_ ancestors is *very* specific to windows, so it needs to be moved to windows.py
---
FILESYSTEM_ MONITOR_ MASK gets broken in this branch because filesystem_ monitor_ mask seems to always be None.
---
All of this would break on darwin: valid_syncdaemo n_path = None valid_os_ path = None
is_
is_
os_path = windowspath = None
So everything under:
elif sys.platform == "darwin":
should come on a following branch.
---
Please rename "reference" to something less vague, and move each definition to the platform specific files.