From eab31270773e396339d273788b84cfbd5a023cec Mon Sep 17 00:00:00 2001 From: Nicholas Marinakis Date: Thu, 10 May 2018 17:46:26 -0700 Subject: [PATCH 1/7] Add some trouble --- test.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test.py b/test.py index 079ef4c..3ac8416 100644 --- a/test.py +++ b/test.py @@ -9,6 +9,7 @@ def __init__(self, foo, bar, baz): self.bar = bar self.baz = baz + @staticmethod def fizz_buzz(digit_1, digit_2): for i in range(1, 100): if i % digit_1 == 0: @@ -21,6 +22,14 @@ def fizz_buzz(digit_1, digit_2): else: print i + def oh_this_is_trouble(self, param1, param2): + """Oh man this fucntion is trouble""" + for i in range(20): + print 'trouble' + i * '!' + for j in range(10): + print i * j + + @staticmethod def json_to_csv(json_file_path, outfile_path): """Convert a file containing a list of flat JSON objects to a csv. @@ -35,3 +44,7 @@ def json_to_csv(json_file_path, outfile_path): writer.writerow(data[0].keys()) for item in data: writer.writerow(item.values()) + +if __name__ == '__main__': + t = TestClass(1, 2, 3) + TestClass.fizz_buzz(3, 5) From 0ae1d826fabd0fe286da90c62d3c796be95c6536 Mon Sep 17 00:00:00 2001 From: Nicholas Marinakis Date: Thu, 10 May 2018 18:01:41 -0700 Subject: [PATCH 2/7] Initial commit --- README.md | 14 ++++++++++++++ test.py | 13 ++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 197aeb6..441d3a9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,17 @@ # Git Practice This repo is for practicing git! + +Please: + +1. Fork this repo +2. Make two changes, in *two separate commits*, to test.py in branch called "Branch_1" + + **One of these changes must be the insertion of a new method between fizz_buzz and json_to_csv** + + It does not matter what these changes are or what the method does. +4. Once you have made the second commit, make another branch off of "Branch_1" called "Branch_2" + +3. Create two pull requests against master: + 1. For the first, please squash down your two "Branch_1" commits. + 2. For the second, please first rebase "Branch_2" on upstream's 'trouble' branch and resolve any conflicts that may arise. diff --git a/test.py b/test.py index 3ac8416..720a873 100644 --- a/test.py +++ b/test.py @@ -9,8 +9,7 @@ def __init__(self, foo, bar, baz): self.bar = bar self.baz = baz - @staticmethod - def fizz_buzz(digit_1, digit_2): + def fizz_buzz(self, digit_1, digit_2): for i in range(1, 100): if i % digit_1 == 0: if i % digit_2 == 0: @@ -22,15 +21,7 @@ def fizz_buzz(digit_1, digit_2): else: print i - def oh_this_is_trouble(self, param1, param2): - """Oh man this fucntion is trouble""" - for i in range(20): - print 'trouble' + i * '!' - for j in range(10): - print i * j - - @staticmethod - def json_to_csv(json_file_path, outfile_path): + def json_to_csv(self, json_file_path, outfile_path): """Convert a file containing a list of flat JSON objects to a csv. What's a DictWriter, you say? Never heard of it! From fd95e9517a1b021aebbe451d85698bbb1a62215a Mon Sep 17 00:00:00 2001 From: Nicholas Marinakis Date: Thu, 10 May 2018 18:02:58 -0700 Subject: [PATCH 3/7] Remove StringIO call --- test.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test.py b/test.py index 720a873..baa4742 100644 --- a/test.py +++ b/test.py @@ -29,7 +29,6 @@ def json_to_csv(self, json_file_path, outfile_path): """ with open(json_file_path) as f: data = json.load(f) - fp = StringIO() with open(outfile_path, 'w') as fp: writer = csv.writer(fp) writer.writerow(data[0].keys()) From 5d27e9a30db6403769d577f709229828aef7feae Mon Sep 17 00:00:00 2001 From: Nicholas Marinakis Date: Thu, 10 May 2018 18:08:36 -0700 Subject: [PATCH 4/7] Update README.md --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 441d3a9..60272bd 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,10 @@ Please: **One of these changes must be the insertion of a new method between fizz_buzz and json_to_csv** - It does not matter what these changes are or what the method does. + It does not matter what these changes are, or what the method does, but each change must introduce at least + five new lines of code. 4. Once you have made the second commit, make another branch off of "Branch_1" called "Branch_2" 3. Create two pull requests against master: - 1. For the first, please squash down your two "Branch_1" commits. - 2. For the second, please first rebase "Branch_2" on upstream's 'trouble' branch and resolve any conflicts that may arise. + 1. For the first, please first squash down your two "Branch_1" commits. + 2. For the second, please first rebase "Branch_2" on upstream's 'trouble' branch and resolve any conflicts that may arise. DO NOT squash your commits. From 52695876b4be5f9c5cd8fcc4d1d6d5e8d56d468d Mon Sep 17 00:00:00 2001 From: Nicholas Marinakis Date: Thu, 10 May 2018 18:14:48 -0700 Subject: [PATCH 5/7] More README formatting --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 60272bd..d5a5166 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This repo is for practicing git! Please: 1. Fork this repo -2. Make two changes, in *two separate commits*, to test.py in branch called "Branch_1" +2. Make two changes, in *two separate commits*, to `test.py` in a branch called "Branch_1" **One of these changes must be the insertion of a new method between fizz_buzz and json_to_csv** From 75ec6990537fe14add3b53b0ff0e039132a36b44 Mon Sep 17 00:00:00 2001 From: Nirupama Kamat Date: Thu, 4 Oct 2018 20:51:32 -0700 Subject: [PATCH 6/7] first commit --- test.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test.py b/test.py index baa4742..ec804eb 100644 --- a/test.py +++ b/test.py @@ -21,6 +21,13 @@ def fizz_buzz(self, digit_1, digit_2): else: print i + def print_method(self): + print self.foo + print self.bar + print self.baz + print "Done" + print "Bye" + def json_to_csv(self, json_file_path, outfile_path): """Convert a file containing a list of flat JSON objects to a csv. From ce07acacfb7c8ea0159a60b9f81e108e9227b51f Mon Sep 17 00:00:00 2001 From: Nirupama Kamat Date: Thu, 4 Oct 2018 20:57:21 -0700 Subject: [PATCH 7/7] second commit --- test.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test.py b/test.py index ec804eb..61a96db 100644 --- a/test.py +++ b/test.py @@ -42,6 +42,18 @@ def json_to_csv(self, json_file_path, outfile_path): for item in data: writer.writerow(item.values()) + def another_method(self, digit_1, digit_2): + for i in range(1, 100): + if i % digit_1 == 0: + if i % digit_2 == 0: + print 'Hello There!' + else: + print 'fizz!' + elif i % digit_2 == 0: + print 'Hi!' + else: + print i + if __name__ == '__main__': t = TestClass(1, 2, 3) TestClass.fizz_buzz(3, 5)