-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
99 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
from enum import Enum | ||
|
||
|
||
class OperatingSystems(str, Enum): | ||
class OperatingSystem(str, Enum): | ||
LINUX = "Linux" | ||
WINDOWS = "Windows" | ||
MACOS = "Darwin" | ||
|
||
|
||
class IgnoreFiles(str, Enum): | ||
class IgnoreFile(str, Enum): | ||
GITIGNORE = ".gitignore" | ||
DROPBOXIGNORE = ".dropboxignore" |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import pathlib | ||
from typing import Union | ||
|
||
|
||
class BaseFilterer: | ||
def __init__(self, path: Union[str, pathlib.Path]): | ||
self.path = pathlib.Path(path) if isinstance(path, str) else path | ||
|
||
def __iter__(self): | ||
raise NotImplementedError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from dropboxignore.filterers.base import BaseFilterer | ||
from dropboxignore.enums import IgnoreFile | ||
|
||
|
||
class DropboxIgnoreFilterer(BaseFilterer): | ||
def __iter__(self): | ||
yield from self.path.glob(f"**/*{IgnoreFile.DROPBOXIGNORE.value}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from dropboxignore.filterers.base import BaseFilterer | ||
from dropboxignore.enums import IgnoreFile | ||
|
||
|
||
class GitIgnoreFilterer(BaseFilterer): | ||
def __iter__(self): | ||
yield from self.path.glob(f"**/*{IgnoreFile.GITIGNORE.value}") |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from dropboxignore.cli import _cli_partial as cli | ||
from pathlib import Path | ||
from dropboxignore.enums import IgnoreFile | ||
|
||
|
||
def test_delete_success(tmp_path: Path) -> None: | ||
di = tmp_path / IgnoreFile.DROPBOXIGNORE.value | ||
di.touch() | ||
|
||
assert di.exists() | ||
|
||
a = cli(command=f"delete {tmp_path.absolute()}") | ||
|
||
print(a) | ||
assert not di.exists() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from dropboxignore.cli import _cli_partial as cli | ||
from pathlib import Path | ||
from dropboxignore.enums import IgnoreFile | ||
|
||
|
||
def test_delete_success(tmp_path: Path) -> None: | ||
gi = tmp_path / IgnoreFile.GITIGNORE.value | ||
di = tmp_path / IgnoreFile.DROPBOXIGNORE.value | ||
gi.touch() | ||
gi.write_text("*.txt\n") | ||
|
||
assert gi.exists() | ||
assert not di.exists() | ||
|
||
cli(command=f"generate {tmp_path.absolute()}") | ||
|
||
assert di.exists() |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters