Skip to content

Commit 06cbe97

Browse files
committed
Cleanup archive.py
1 parent 5882b23 commit 06cbe97

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/core/archive.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
args = parser.parse_args()
99

1010
TEMP_CACHE = f"{CACHE}/workspace"
11+
temp_file = f"{CACHE}/temp_file"
1112

1213
# Cleanup the cache dir before saving
1314
def cleanup_cache_dir():
@@ -21,7 +22,6 @@ def cleanup_cache_dir():
2122

2223
# Get password entered in the "Create a new password" dialog from the temporary file
2324
def get_password():
24-
temp_file = f"{CACHE}/temp_file"
2525
if os.path.exists(temp_file):
2626
with open(temp_file) as tmp:
2727
return tmp.read().strip()
@@ -31,8 +31,8 @@ def get_password():
3131

3232
# Remove above temporary file
3333
def remove_temp_file():
34-
if os.path.exists(f"{CACHE}/temp_file"):
35-
os.remove(f"{CACHE}/temp_file")
34+
if os.path.exists(temp_file):
35+
os.remove(temp_file)
3636

3737
class Create:
3838
def __init__(self):
@@ -159,7 +159,7 @@ def __handle_sync_error(self):
159159

160160
# Unpack a legacy archive with Tarball (for backward compatibility)
161161
def _unpack_tar_archive(self):
162-
cmd = subprocess.run(["tar", "-xzf", self.import_file, "-C", f"{TEMP_CACHE}"],capture_output=True, text=True, check=True)
162+
cmd = subprocess.run(["tar", "-xzf", self.import_file, "-C", f"{TEMP_CACHE}"], capture_output=True, text=True, check=True)
163163
print(cmd.stdout)
164164

165165
# Replace original /home/$USER path with actual path in the dconf-settings.ini file and other XML files

0 commit comments

Comments
 (0)