Skip to content

Commit b492272

Browse files
committed
renaming methods to be shorter
1 parent cb2b0ff commit b492272

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

reusable_code/okay.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
Hi write me to the file please
1+
Hi write me to the file pleaseHi write me to the file please
2+
Hi write me to the file please

reusable_code/write_to_file_v5.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ def writeText(fileName, text, mode):
2626
raise e
2727

2828
@staticmethod
29-
def createFileOrAppendWithText(fileName, text):
29+
def createOrAppendWithText(fileName, text):
3030
try:
3131
File.writeText(fileName,text, "a+")
3232
except IOError as e:
3333
raise e
3434

3535
@staticmethod
36-
def createFileWithText(fileName, text):
36+
def createWithText(fileName, text):
3737
try:
3838
File.writeText(fileName,text, "w+")
3939
except IOError as e:
@@ -44,7 +44,7 @@ def createFileWithText(fileName, text):
4444
okayFile = "okay.txt"
4545

4646
try:
47-
File.createFileOrAppendWithText(okayFile, textToSave)
47+
File.createOrAppendWithText(okayFile, textToSave)
4848
except Exception as e:
4949
print("Uncaught exception %s" % (e))
5050
exit(1)

0 commit comments

Comments
 (0)