Skip to content

Commit dddb19d

Browse files
author
Peter Fison
committed
Point fixes for CleverDict 1.8.1 compatibility
1 parent 55e3be0 commit dddb19d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

easypypi/easypypi.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def __str__(self):
6868
output = self.info(as_str=True)
6969
return output.replace("CleverDict", type(self).__name__, 1)
7070

71-
def save(self, key=None, value=None):
71+
def save(self, name=None, value=None):
7272
"""
7373
This method is called by CleverDict whenever a value or attribute
7474
changes. Used here to update the config file automatically.
@@ -96,8 +96,8 @@ def save(self, key=None, value=None):
9696
if "password" not in x.lower()
9797
}
9898
json.dump(fields_dict, file, indent=4)
99-
if key:
100-
if "password" in key.lower():
99+
if name:
100+
if "password" in name.lower():
101101
location = "memory but NOT saved to file"
102102
else:
103103
location = self.__class__.config_filepath
@@ -771,6 +771,7 @@ def create_essential_files(self):
771771
sfp = self.setup_filepath.parent
772772
# setup.py and LICENSE can be be overwritten as they're most likely to
773773
# be changed by user after publishing, and no code changes will be lost:
774+
print(self.license_text)
774775
create_file(sfp / "LICENSE", self.license_text, overwrite=True)
775776
create_file(self.setup_filepath, self.script_lines, overwrite=True)
776777
# Other files are just bare-bones initially, imported from templates:

easypypi/shared_functions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ def create_file(filepath, content, **kwargs):
1919
backup = filepath.with_name(f"{filepath.stem} - old.py")
2020
filepath.replace(backup)
2121
print(f"\n✓ Renamed {filepath.name} to:\n {backup.name}")
22-
filepath.touch() # Create empty file to append lines to
22+
else:
23+
os.remove(filepath)
2324
else:
2425
print(f"\nⓘ Existing file preserved:\n {filepath}")
2526
return "file exists"

0 commit comments

Comments
 (0)