File tree 7 files changed +30
-4
lines changed
7 files changed +30
-4
lines changed Original file line number Diff line number Diff line change 1
1
dist *
2
2
build *
3
3
.idea *
4
- * .pyc
4
+ * .pyc
5
+ * .swp
Original file line number Diff line number Diff line change @@ -74,8 +74,11 @@ def file_handler(self):
74
74
file_type = detect_mimetype (file_ )
75
75
# We're looking for startswith('text/'). Mimetype returns
76
76
# None if it can't determine file type. Remove if either is True
77
- if file_type [0 ].startswith ("application" ) or file_type [0 ] is None :
78
- files_found .remove (file_ )
77
+ try :
78
+ if file_type [0 ].startswith ("application" ) or file_type [0 ] is None :
79
+ files_found .remove (file_ )
80
+ except (AttributeError , IndexError ) as e :
81
+ print "Failed to open file {} with error of {}" .format (file_ , e )
79
82
80
83
for file_ in files_found :
81
84
try :
@@ -94,6 +97,7 @@ def lookup_language(self):
94
97
lang_map = {'cpp' : LanguageCPP ,
95
98
'python' : LanguagePython ,
96
99
'javascript' : LanguageJavascript ,
97
- 'c' : LanguageC }
100
+ 'c' : LanguageC ,
101
+ 'go' : LanguageGo }
98
102
langs = [i for i in self .github .get_languages ()]
99
103
return [lang_map [str (langs [0 ][0 ]).lower ()]()]
Original file line number Diff line number Diff line change @@ -29,3 +29,11 @@ def __init__(self):
29
29
self .multi_comment = ['/*' , '*/' ]
30
30
self .file_exts = ['*.js' , '.node' ]
31
31
self .ignore = ['node_modules' ]
32
+
33
+ class LanguageGo :
34
+ def __init__ (self ):
35
+ self .single_comment = '//'
36
+ self .multi_comment = ['/*' , '*/' ]
37
+ self .file_exts = ['*.go' ]
38
+ self .ignore = []
39
+
Original file line number Diff line number Diff line change 1
1
github3.py == 0.9.5
2
2
requests == 2.9.1
3
+ mock == 1.3.0
3
4
uritemplate.py == 0.3.0
4
5
wheel == 0.24.0
5
6
nose2 == 0.5.0
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ def read(fname):
7
7
8
8
setup (
9
9
name = 'pygemony' ,
10
+ install_requires = read ('requirements.txt' ),
10
11
version = '0.0.1a' ,
11
12
description = ('Parse TODO from github directory' ),
12
13
license = "MIT" ,
Original file line number Diff line number Diff line change
1
+
Original file line number Diff line number Diff line change
1
+ from mock import patch
1
2
3
+ import unittest
4
+
5
+ from pyg .Pygemony import Pygemony
6
+
7
+ class PygemonyTestCase (unittest .TestCase ):
8
+
9
+ def test_hashing_pass (self ):
10
+ md5 = Pygemony .hash_todo ("# TODO(ian): Testing 123" )
11
+ self .assertEqual (md5 , "8b462bbebbaf3628e4b84b12b9d178af" )
You can’t perform that action at this time.
0 commit comments