1
1
What The Patch!?
2
2
================
3
3
4
- What The Patch!? is a Python 2 library for parsing patch files.
5
- It's only purpose is to read a patch file and get it into some
6
- usable form by other programs.
4
+ What The Patch!? is a library for parsing patch files. It's only purpose is to
5
+ read a patch file and get it into some usable form by other programs.
7
6
8
7
Features
9
8
---------
@@ -63,7 +62,8 @@ Let us say we have a patch file containing some changes, aptly named
63
62
Parsing
64
63
-------
65
64
66
- Here is how we would use What The Patch!? in Python to get the changeset for each diff in the patch:
65
+ Here is how we would use What The Patch!? in Python to get the changeset for
66
+ each diff in the patch:
67
67
68
68
.. code-block :: python
69
69
@@ -74,29 +74,30 @@ Here is how we would use What The Patch!? in Python to get the changeset for eac
74
74
>> > for diff in whatthepatch.parse_patch(text):
75
75
... print (diff)
76
76
...
77
- diff(header = header(index_path = None ,
78
- old_path = ' lao' ,
79
- old_version = ' 2012-12-26 23:16:54.000000000 -0600' ,
80
- new_path = ' tzu' ,
81
- new_version = ' 2012-12-26 23:16:50.000000000 -0600'
82
- ),
77
+ diff(header = header(
78
+ index_path = None ,
79
+ old_path = ' lao' ,
80
+ old_version = ' 2012-12-26 23:16:54.000000000 -0600' ,
81
+ new_path = ' tzu' ,
82
+ new_version = ' 2012-12-26 23:16:50.000000000 -0600'
83
+ ),
83
84
changes = [
84
- (1 , None , ' The Way that can be told of is not the eternal Way;' ),
85
- (2 , None , ' The name that can be named is not the eternal name.' ),
86
- (3 , 1 , ' The Nameless is the origin of Heaven and Earth;' ),
87
- (4 , None , ' The Named is the mother of all things.' ),
88
- (None , 2 , ' The named is the mother of all things.' ),
89
- (None , 3 , ' ' ),
90
- (5 , 4 , ' Therefore let there always be non-being,' ),
91
- (6 , 5 , ' so we may see their subtlety,' ),
92
- (7 , 6 , ' And let there always be being,' ),
93
- (9 , 8 , ' The two are the same,' ),
94
- (10 , 9 , ' But after they are produced,' ),
95
- (11 , 10 , ' they have different names.' ),
96
- (None , 11 , ' They both may be called deep and profound.' ),
97
- (None , 12 , ' Deeper and more profound,' ),
98
- (None , 13 , ' The door of all subtleties!' )
99
- ]
85
+ (1 , None , ' The Way that can be told of is not the eternal Way;' ),
86
+ (2 , None , ' The name that can be named is not the eternal name.' ),
87
+ (3 , 1 , ' The Nameless is the origin of Heaven and Earth;' ),
88
+ (4 , None , ' The Named is the mother of all things.' ),
89
+ (None , 2 , ' The named is the mother of all things.' ),
90
+ (None , 3 , ' ' ),
91
+ (5 , 4 , ' Therefore let there always be non-being,' ),
92
+ (6 , 5 , ' so we may see their subtlety,' ),
93
+ (7 , 6 , ' And let there always be being,' ),
94
+ (9 , 8 , ' The two are the same,' ),
95
+ (10 , 9 , ' But after they are produced,' ),
96
+ (11 , 10 , ' they have different names.' ),
97
+ (None , 11 , ' They both may be called deep and profound.' ),
98
+ (None , 12 , ' Deeper and more profound,' ),
99
+ (None , 13 , ' The door of all subtleties!' )
100
+ ]
100
101
)
101
102
102
103
*Edited to show structure of the results *
0 commit comments