Skip to content
This repository was archived by the owner on Nov 10, 2021. It is now read-only.

Commit af2651d

Browse files
committed
Release 0.4.0
I've added functions for reading and overwriting files. And also this is the first signed commit.
1 parent f2f4661 commit af2651d

3 files changed

Lines changed: 36 additions & 3 deletions

File tree

File-Manager.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,38 @@ def Jump(thispath, Jump_func_text, Directory_text):
287287
print(Fore.LIGHTRED_EX)
288288
print('Error: This function is missing.')
289289

290-
# The part responsible for closing the program.
290+
# This part is responsible for reading files.
291291

292292
elif function == 7:
293+
All_files(thispath)
294+
print(Fore.LIGHTCYAN_EX)
295+
file = input(file_text)
296+
FO = open(file, 'r')
297+
print(Fore.RESET)
298+
for line in FO:
299+
print(line)
300+
FO.close()
301+
302+
# This is the part that is responsible for overwriting files.
303+
304+
elif function == 8:
305+
All_files(thispath)
306+
file = input(file_text)
307+
FO = open(file, 'w')
308+
FW = 'y'
309+
while FW == 'y':
310+
print(Fore.LIGHTCYAN_EX + FO_txt_text)
311+
print(Fore.RESET)
312+
FO_txt = input('')
313+
FO.write(FO_txt + '\n')
314+
print(Fore.LIGHTGREEN_EX)
315+
FW = input(FW_text)
316+
FW = FW.lower()
317+
FO.close()
318+
319+
# The part responsible for closing the program.
320+
321+
elif function == 9:
293322
print(Fore.RESET)
294323
start = False
295324

Lang_en.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
thispath = 'You are on this path:'
44
Jump_func_text = '1) Move to previous directory \n2) Move to next directory \n'
55
Directory_text = 'Enter directory name: '
6-
function_text = 'File-Manager made by RIDERIUS \nVersion 0.3.0 \n1) View all files \n2) Move between directories \n3) Copy \n4) Move \n5) Change \n6) Delete \n7) Close \n'
6+
function_text = 'File-Manager made by RIDERIUS \nVersion 0.4.0 \n1) View all files \n2) Move between directories \n3) Copy \n4) Move \n5) Change \n6) Delete \n7) Reading a file \n8) File overwrite \n9) Close \n'
77
Copy_func_text = '1) Copy files \n2) Copy directory \n'
88
file_text = 'Enter file name: '
99
CaMO = 'Copy to this directory? (y/n) '
@@ -13,3 +13,5 @@
1313
Remove_func_text = '1) Deleting files \n2) Deleting directories \n'
1414
REFI_func_text = '1) Permanently deleting files \n2) Deleting files through the trash can \n'
1515
REDIR_func_text = '1) Permanently deleting directories \n2) Deleting directories via the trash can \n'
16+
FO_txt_text = 'Enter the text that will be written to the file: \n'
17+
FW_text = 'Another line? (y/n) '

Lang_ru.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
thispath = 'Вы находитесь по этому пути:'
44
Jump_func_text = '1)Переход в предыдущую директорию\n2)Переход в следующую директорию\n'
55
Directory_text = 'Введите название директории: '
6-
function_text = 'File-Manager сделал RIDERIUS\nВерсия 0.3.0\n1)Просмотр всех файлов\n2)Переход между директориями\n3)Копирование\n4)Перемещение\n5)Переменовать\n6)Удаление\n7)Закрыть\n'
6+
function_text = 'File-Manager сделал RIDERIUS\nВерсия 0.4.0\n1)Просмотр всех файлов\n2)Переход между директориями\n3)Копирование\n4)Перемещение\n5)Переменовать\n6)Удаление\n7)Чтение файла\n8)Перезапись файла\n9)Закрыть\n'
77
Copy_func_text = '1)Копирование файлов\n2)Копирование директории\n'
88
file_text = 'Введите название файла: '
99
CaMO_text = 'В эту директорию копировать?(y/n) '
@@ -13,3 +13,5 @@
1313
Remove_func_text = '1)Удаление файлов\n2)Удаление директорий\n'
1414
REFI_func_text = '1)Перманентное удаление файлов\n2)Удаление файлов через корзину\n'
1515
REDIR_func_text = '1)Перманентное удаление директорий\n2)Удаление директорий через корзину\n'
16+
FO_txt_text = 'Введите текст, который запишется в файл: \n'
17+
FW_text = 'Ещё одну строку?(y/n) '

0 commit comments

Comments
 (0)