-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
153 additions
and
36 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1 @@ | ||
[ | ||
{ | ||
"outputType": { | ||
"type": "APK" | ||
}, | ||
"apkInfo": { | ||
"type": "MAIN", | ||
"splits": [], | ||
"versionCode": 3, | ||
"versionName": "1.6.1", | ||
"enabled": true, | ||
"outputFile": "app-release.apk", | ||
"fullName": "release", | ||
"baseName": "release" | ||
}, | ||
"path": "app-release.apk", | ||
"properties": {} | ||
} | ||
] | ||
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":4,"versionName":"1.7.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
#!/usr/bin/python3 | ||
# i write all codes on 1 file because its easy to move for users ;) | ||
|
||
from fnmatch import filter | ||
import os | ||
import sys | ||
|
||
|
||
def ShowHelp(): | ||
print() | ||
print(" " + 62 * "-") | ||
print("| ProjectAnalyzer |") | ||
print("| |") | ||
print("| github:https://github.com/ali77gh/ProjectAnalyzer |") | ||
print("| |") | ||
print("| how to use : |") | ||
print("| > python3 analyze.py 'postfix' |") | ||
print("| > python3 analyze.py 'postfix' --ignore 'dir or files names'|") | ||
print(" " + 62 * "-") | ||
print() | ||
|
||
|
||
def ShowInBox(str): | ||
print("| " + str + ((51-len(str)) * " ") + "|") | ||
|
||
|
||
def Line(): | ||
print(" " + 52 * "-") | ||
|
||
|
||
def getFileList(path, filePostfix): | ||
array = [] | ||
file_name = "*."+filePostfix | ||
for root, dirs, files in os.walk(path): | ||
for filename in filter(files, file_name): | ||
array.append(os.path.join(root, filename)) | ||
return array | ||
|
||
|
||
def getLineNumbers(Files): | ||
lines = 0 | ||
for i in Files: | ||
lines += sum(1 for line in open(i)) | ||
return lines | ||
|
||
|
||
|
||
def RemoveIgnores(allFiles, ignores): | ||
for i in allFiles: | ||
for j in ignores: | ||
if i.find(j)>0: | ||
allFiles.remove(i) | ||
|
||
|
||
def ValidateInputs(): | ||
firstMode = len(sys.argv) == 2 and (not sys.argv[1] == "--ignore") | ||
secondMode = len(sys.argv) > 3 and sys.argv[2] == "--ignore" | ||
if (not firstMode) and (not secondMode): | ||
print("bad way to use") | ||
ShowHelp() | ||
exit(0) | ||
|
||
# main | ||
if len(sys.argv) == 1 or sys.argv[1] == "--help" : | ||
ShowHelp() | ||
exit(0) | ||
|
||
ValidateInputs() | ||
|
||
ignores = [] | ||
if len(sys.argv) > 3 and sys.argv[2] == "--ignore": | ||
ignores = sys.argv[3:] | ||
|
||
postfix = sys.argv[1] | ||
|
||
Line() | ||
ShowInBox(" ProjectAnalyzer") | ||
ShowInBox("") | ||
ShowInBox("https://github.com/ali77gh/ProjectAnalyzer") | ||
ShowInBox("") | ||
ShowInBox("searching...") | ||
files = getFileList(os.getcwd(), postfix) | ||
RemoveIgnores(files, ignores) | ||
if len(files) == 0: | ||
ShowInBox("there is no " + postfix + " file") | ||
Line() | ||
exit() | ||
|
||
try: | ||
lines = getLineNumbers(files) | ||
except UnicodeDecodeError as e: | ||
ShowInBox("this file type is not unicode :|") | ||
Line() | ||
exit() | ||
|
||
linePerFile = round(lines / len(files), 2) | ||
ShowInBox("you have " + str(len(files)) + " " + postfix + " files") | ||
ShowInBox("you have " + str(lines) + " " + " lines of " + postfix) | ||
ShowInBox("lines per file average: " + str(linePerFile)) | ||
ShowInBox("") | ||
Line() | ||
|
||
# todo --ignore param |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters