Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d921c41

Browse filesBrowse files
authored
add new function to library and init
1 parent 2401d60 commit d921c41
Copy full SHA for d921c41

File tree

Expand file treeCollapse file tree

2 files changed

+12
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+12
-1
lines changed

‎PDL/package/pdlparse/__init__.py

Copy file name to clipboard
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#https://www.freecodecamp.org/news/build-your-first-python-package/
22
from parse import scrap_library, get_variable, filter_file, get_strings, get_class, get_type, get_value, get_comments
3-
from library import get_libs, get_lib_info, get_main_lib, read_lib, format_lib, remove_comments
3+
from library import get_libs, get_lib_info, get_main_lib, read_lib, format_lib, rm_library, remove_comments
44
from new import create_lib, create_lib_script, create_manifest

‎PDL/package/pdlparse/library.py

Copy file name to clipboardExpand all lines: PDL/package/pdlparse/library.py
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,17 @@ def format_lib(library):
133133
pass
134134

135135

136+
def rm_library(library):
137+
# Burry the library 6-feet under. (delete it)
138+
if not os.path.exists(library):
139+
raise FileNotFoundError(f'ERROR: Package pdlparse cannot find file {library}.')
140+
141+
try:
142+
os.remove(library)
143+
except Exception as e:
144+
raise Exception(f'ERROR: An unknown error occurred during runtime \n{e}\n')
145+
146+
136147
def remove_comments(library):
137148
# Removes all comments from a library
138149
if not os.path.exists(library):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.