mirror of
https://github.com/fastogt/pyfastogt
synced 2025-03-09 23:38:55 +00:00
base folder
This commit is contained in:
parent
500c077a9f
commit
fa0548f3ce
4 changed files with 281 additions and 0 deletions
20
base/utils.py
Normal file
20
base/utils.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
|
||||
class BuildError(Exception):
|
||||
def __init__(self, value):
|
||||
self.value_ = value
|
||||
def __str__(self):
|
||||
return self.value_
|
||||
|
||||
def read_file_line_by_line(file):
|
||||
if not os.path.exists(file):
|
||||
raise BuildError('file path: %s not exists' % file)
|
||||
|
||||
file_array = []
|
||||
with open(file, "r") as ins:
|
||||
for line in ins:
|
||||
file_array.append(line.strip())
|
||||
|
||||
return file_array
|
Loading…
Add table
Add a link
Reference in a new issue