Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
snakehouse
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
public
snakehouse
Commits
2208cb99
Unverified
Commit
2208cb99
authored
9 months ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
remove satella
parent
9309ab88
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#61307
failed with stage
Stage: test
in 2 minutes and 38 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
MANIFEST.in
+0
-1
0 additions, 1 deletion
MANIFEST.in
snakehouse/requirements.py
+1
-1
1 addition, 1 deletion
snakehouse/requirements.py
snakehouse/satella.py
+17
-0
17 additions, 0 deletions
snakehouse/satella.py
with
18 additions
and
2 deletions
MANIFEST.in
+
0
−
1
View file @
2208cb99
include LICENSE
include README.md
include CONTRIBUTORS.md
include snakehouse/templates/*.mako
include requirements.txt
This diff is collapsed.
Click to expand it.
snakehouse/requirements.py
+
1
−
1
View file @
2208cb99
import
typing
as
tp
import
warnings
from
satella
.files
import
read_lines
,
find_files
from
.
satella
import
read_lines
,
find_files
def
find_pyx
(
directory_path
:
str
)
->
tp
.
List
[
str
]:
...
...
This diff is collapsed.
Click to expand it.
snakehouse/satella.py
+
17
−
0
View file @
2208cb99
...
...
@@ -67,6 +67,23 @@ def find_files(path: str, wildcard: str = r'(.*)',
if
re
.
match
(
wildcard
,
fn_path
):
yield
_cond_join
(
prefix_with
,
filename
)
def
read_lines
(
path
:
str
,
delete_empty_lines
:
bool
=
True
,
encoding
:
str
=
'
utf-8
'
)
->
tp
.
List
[
str
]:
"""
Read lines from a particular file, removing end-of-line characters and optionally
empty lines. Additionally whitespaces (and end-of-line characters) will be removed
from both ends of each line.
:param path: path of file to read
:param delete_empty_lines: set to False if empty lines are not to be removed
:param encoding: encoding to read the file with
:return: each line as a separate entry
"""
with
codecs
.
open
(
path
,
'
r
'
,
encoding
)
as
f_in
:
lines
=
[
line
.
strip
()
for
line
in
f_in
.
readlines
()]
if
delete_empty_lines
:
lines
=
[
line
for
line
in
lines
if
line
]
return
lines
def
split
(
path
:
str
)
->
tp
.
List
[
str
]:
"""
...
...
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