hashit.__main__ (version 3.5.1)
index
/Users/javad/Dropbox/udvikling/projekter/hashit/hashit/hashit/__main__.py

Command line application for hashit
 
this module "__main__" contains all the code for argparsing, running
and anything needed for an command lin application such as hashit.
 
it uses argc another package by me, but i am considering switching to argparse

 
Modules
       
argparse
hashlib
os
random
traceback

 
Classes
       
argparse.Action(argparse._AttributeHolder)
Execute
Print

 
class Execute(argparse.Action)
    Execute(nargs=0, **kwargs)
 
Same as Print() but instead of printing an object it calls it takes func (function), and exit (bool)
 
 
Method resolution order:
Execute
argparse.Action
argparse._AttributeHolder
builtins.object

Methods defined here:
__call__(self, parser, namespace, values, option_string=None)
Call self as a function.
__init__(self, nargs=0, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.

Methods inherited from argparse._AttributeHolder:
__repr__(self)
Return repr(self).

Data descriptors inherited from argparse._AttributeHolder:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class Print(argparse.Action)
    Print(nargs=0, **kwargs)
 
Print action for argparse, takes one kwarg which is text the varible which contains the string to be printed
 
 
Method resolution order:
Print
argparse.Action
argparse._AttributeHolder
builtins.object

Methods defined here:
__call__(self, parser, namespace, values, option_string=None)
Call self as a function.
__init__(self, nargs=0, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.

Methods inherited from argparse._AttributeHolder:
__repr__(self)
Return repr(self).

Data descriptors inherited from argparse._AttributeHolder:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
Exit = exit(...)
exit([status])
 
Exit the interpreter by raising SystemExit(status).
If the status is omitted or None, it defaults to zero (i.e., success).
If the status is an integer, it will be used as the system exit status.
If it is another kind of object, it will be printed and the system
exit status will be one (i.e., failure).
config(parser)
Sets argvs' config and commands with argparse and returns it for good sake
exclude(items, excludes)
Exclude removes all items in a list that is in the excludes list (for dirs)
main(args=None)
Main function with error catching, can force-exit with os._exit(1)
 
this main function calls main_() and cathes any error while giving the user some "pretty"
errors.
main_(args)
Main function which is the cli parses arguments and runs appropriate commands
walk(go_over)
Goes over a path an finds all files, appends them to a list and returns that list

 
Data
        GLOBAL = {'ACCESS': True, 'BLANK': (None, True, False), 'COLORS': {'GREEN': '\x1b[0;32m', 'RED': '\x1b[0;31m', 'RESET': '\x1b[0m', 'YELLOW': '\x1b[0;33m'}, 'DEFAULTS': {'APPEND': False, 'COLORS': True, 'DETECT': False, 'DRYRUN': False, 'HASH': 'md5', 'MEMOPT': False, 'QUIET': False, 'RECURS': False, 'SIZE': False, 'STRICT': False, ...}, 'DEVMODE': True, 'ERRORS': {'FileNotFoundError': "Error, file seems to be missing calling systemd to confirm 'sure you haved checked the MBR?'", 'IndexError': 'Out of range, cause i am not that big :)', 'OSError': {'END': 'JDK, so something happend with your os, message: ', 'linux': 'So {} , to be continued...\n', 'macos': 'Macos (Sierra+) and OSX (El Captain-) thank god for apples naming', 'windows': 'Windows 10, windows 8(.1), windows 7 (sp*), wind...p*), windows 98/95, windows NT *. OK not that bad'}, 'TypeError': 'Wrong type used (in cli-arguments) - please use a static programming language', 'ValueError': 'Wrong type or mood?! :)'}, 'EXTRA': {'crc32': <class 'hashit.extra.Crc32'>}, 'HASH_STR': 'Hello World!', 'IF_NO_ARGS': ['--string'], 'MESSAGES': {'CUR_FORM': 'current format is', 'DRYRUN_NOT': 'Does not support --dry-run', 'EMPTY_CHK': 'checksum file is empty', 'FAIL': 'FAILED', 'FILE_NOT': 'File does not exist', 'HASH_NOT': 'is not a valid hash', 'LENGTH_NOT': 'The files does not have the same length', 'LOAD_FAIL': 'Failed to load', 'MAYBE': 'Maybe', 'MAYBE_M': 'Did you maybe mean:', ...}, ...}
LINUX_LIST = ['Mythbuntu', 'Mac OS X', 'Debian Pure Blend', 'Symphony OS', 'Astra Linux', 'Emdebian Grip', 'Russian Fedora Remix', 'Secure-K', 'Knopperdisk', 'Mobilinux', 'touchscreen', 'MX Linux', 'NepaLinux', 'fli4l', 'Nix', 'Ubuntu Mobile', 'primary', 'Fedora Core', 'ChromeOS', 'rPath', ...]
__algorithms__ = ['md5', 'sha1', 'crc32', 'sha384', 'sha256', 'sha224', 'sha512', 'blake2b', 'blake2s', 'sha3_224', 'sha3_384', 'sha3_256', 'sha3_512']
__help__ = 'Hashit is an hashing program which can be uses t...ot the idea to make such a program using\npython.\n'
__license__ = 'MIT, Copyright (c) 2017-2020 Javad Shafique'

 
Author
        Javad Shafique