Skip to content

Automatically creates header comments for my python homework files (really any python files I guess)

Notifications You must be signed in to change notification settings

nmarth2993/autocomment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

autocomment

Description

This program automatically creates header comments for my python homework files. The header files are in the format:

"""
File:         README.adoc
Author:       Nicholas Marthinuss
Date:         9/7/2020
Section:      Lab section
Email:        Email
Description:  This file is a readme and describes
              the functionality and usage of the program.
"""

Usage

autocomment [dir | --help]

--help: prints the help message
dir: name of directory to find the python source files

First usage

When you invoke this program for the first time, it will look for the file ~/.autocomment/constants

If the program does not find the file, it will prompt you to enter your name, section, and email.

As long as the file remains, the program will use the information in that file to populate the header.

If the file is deleted, it will prompt the user to input the required information again.

Entering Descriptions

With comment

Descriptions may be provided by a comment on the first line of the program.

To supply a description this way, a comment must follow the format:

# @desc: Sample description

A description supplied through a comment will be automatically folded, every 30 characters by default.

Without comment

For each file in the supplied directory without a description comment, the program will prompt the user to enter a description for the file.

In description entry mode, the user must choose where to put line breaks. Pressing enter will insert a newline in the description.

A blank line signals the end of description input. The program then prompts for the description of the next file for each file in the directory.

Compilation

Compiled with

gcc autocomment.c -o autocomment

Shell Scripts

mkhw

mkhw is a simple script that creates the 5 required homework files in the format

hw$_part*.py

where $ is the assignment number and * is the part number

Usage

to use mkhw, you only need to provide the homework number

mkhw 3

will create the files hw3_part*.py

turnin

turnin simply runs autocomment on all of the files in the current directory and then submits them to the given class and assignment

Usage

turnin expects a class name and an assignment name

to turn in all files in the current directory to cmsc201’s HW4 assignment:

turnin cmsc201 HW4
Note
turnin is generally the command to use when you are ready to submit, as it comments the files and turns them in. if you use autocomment before using turnin, it will cause a redundant header comment

About

Automatically creates header comments for my python homework files (really any python files I guess)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published