Skip to content

Instantly share code, notes, and snippets.

@josephwegner
Created June 18, 2011 03:01
Show Gist options
  • Save josephwegner/1032760 to your computer and use it in GitHub Desktop.
Save josephwegner/1032760 to your computer and use it in GitHub Desktop.
Quickly and Easily create scaffolding for whatever language you want
/******************
Name:
Project:
Purpose:
******************* /*
#include <iostream>
using namespace std;
int main()
{
}
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
});
</script>
</head>
<body>
</body>
</html>
/***************
Name:
Project:
Purpose:
**************** */
/*********************
*Build Exports Object*
**********************/
<?php
/*****************
Name:
Project:
Purpose:
****************** */
?>
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
});
</script>
</head>
<body>
</body>
</html>
#!/usr/bin/env python
"""
Name: Joe Wegner
Project: easyScaffolding
Purpose: Easily create scaffolding for a multitude
of programming languages. Users can easily edit
and add scaffolds for their needs
"""
"""
How to Use: (From Command Line)
scaffolding.py <language> <file_name>
<language> => The language you would like to generate scaffolding
for. This language must have a matching scaffolding file,
but errors will be handled gracefully.
<file_name> => Pretty straight forward. This can be a path, or
just a simple file name.
"""
import sys
import os
import shutil
if(len(sys.argv) < 2):
print "You did not enter the target language!"
sys.exit()
if(len(sys.argv) < 3):
print "You did not enter a file name!"
sys.exit()
language = sys.argv[1]
filename = sys.argv[2]
src = os.getenv("HOME") + "/.scaffolding/" + language + ".scaff"
if(not os.path.exists(src)):
print "You don't have a scaffolding file for that language!"
sys.exit()
try:
shutil.copy(src, filename)
except (IOError), why:
print why
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment