Skip to content

Commit

Permalink
v.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
barnumbirr committed Apr 18, 2015
1 parent dc226ae commit ba47c73
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 52 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ DirectMap2M: 8187904 kB
['SwapCached: 0 kB\n', 'SwapTotal: 16776188 kB\n', 'SwapFree: 16776188 kB\n']
```



## License:

```
Expand Down
86 changes: 42 additions & 44 deletions STATS
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@

Analyzing: https://github.com/c0ding/hazelnut/blob/master/hazelnut/core.py

Total Lines: 38
Total Lines: 30

Code Lines: 28 (73.6842%)
Blank Lines: 9 (23.6842%)
Code Lines: 22 (73.3333%)
Blank Lines: 7 (23.3333%)

Comment Lines: 1 (2.63157%)
Doc String Lines: 0 (0.0%)
Inline Comments: 1
Doc Strings: 0
Total Comments: 2
Comment Lines: 1 (3.33333%)
Doc String Lines: 0 (0.0%)
Inline Comments: 1
Doc Strings: 0
Total Comments: 2

Longest Code Line: 47
Shortest Code Line: 8 [return d]
Longest Code Line: 41
Shortest Code Line: 12 [return match]

Longest Comment Line: 23
Shortest Comment Line: 23 [# -*- coding: utf-8 ...]

Imports: 1
Functions: 6
Classes: 1
If Statements: 0
Try Statements: 0
Except Statements: 0
Print Statements: 0
Assignments: 11
Variables: 10
Longest Comment Line: 23
Shortest Comment Line: 23 [# -*- coding: utf-8 ...]

Imports: 1
Functions: 6
Classes: 1
If Statements: 0
Try Statements: 0
Except Statements: 0
Print Statements: 0
Assignments: 5
Variables: 5

Done analyzing: https://github.com/c0ding/hazelnut/blob/master/hazelnut/core.py
Code stats generated by codecounter v.2.0.1
Expand All @@ -36,33 +35,32 @@

Analyzing: https://github.com/c0ding/hazelnut/blob/master/hazelnut/__init__.py

Total Lines: 10

Code Lines: 7 (70.0%)
Blank Lines: 2 (20.0%)
Total Lines: 10

Comment Lines: 1 (10.0%)
Doc String Lines: 0 (0.0%)
Inline Comments: 1
Doc Strings: 0
Total Comments: 2
Code Lines: 7 (70.0%)
Blank Lines: 2 (20.0%)

Longest Code Line: 47
Shortest Code Line: 19 [__version__ = '0.2']
Comment Lines: 1 (10.0%)
Doc String Lines: 0 (0.0%)
Inline Comments: 1
Doc Strings: 0
Total Comments: 2

Longest Comment Line: 23
Shortest Comment Line: 23 [# -*- coding: utf-8 ...]
Longest Code Line: 47
Shortest Code Line: 19 [__version__ = '0.2']

Imports: 1
Functions: 0
Classes: 0
If Statements: 0
Try Statements: 0
Except Statements: 0
Print Statements: 0
Assignments: 5
Variables: 5
Longest Comment Line: 23
Shortest Comment Line: 23 [# -*- coding: utf-8 ...]

Imports: 1
Functions: 0
Classes: 0
If Statements: 0
Try Statements: 0
Except Statements: 0
Print Statements: 0
Assignments: 5
Variables: 5

Done analyzing: https://github.com/c0ding/hazelnut/blob/master/hazelnut/__init__.py
Code stats generated by codecounter v.2.0.1
2 changes: 1 addition & 1 deletion hazelnut/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

__title__ = 'hazelnut'
__version__ = '0.2'
__version__ = '0.3'
__author__ = 'Martin Simon <me@martinsimon.me>'
__repo__ = 'https://github.com/c0ding/hazelnut'
__license__ = 'Apache v2.0 License'
Expand Down
7 changes: 3 additions & 4 deletions hazelnut/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@

import re


class MemInfo(object):
def __init__(self, path='/proc/meminfo'):
self.path = path

def fileobj(self):
return open(self.get_path(), 'r')
return open(self.path, 'r')

def __str__(self):
with self.fileobj() as f:
lines = [line.strip() for line in f]
return '\n'.join(lines)
return '\n'.join(lines)

def __repr__(self):
return self.__str__()
Expand All @@ -28,4 +27,4 @@ def search(self, regex):
with self.fileobj() as f:
matcher = re.compile(regex, re.IGNORECASE)
match = filter(matcher.match, f)
return match
return match
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='hazelnut',
version='0.2',
version='0.3',
url='https://github.com/c0ding/hazelnut',
download_url='https://github.com/c0ding/hazelnut/archive/master.zip',
author='Martin Simon',
Expand Down

0 comments on commit ba47c73

Please sign in to comment.