-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from dag-hammarskjold-library/jbukhari-patch-1
Add sample script
- Loading branch information
Showing
3 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
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,7 +1,7 @@ | ||
|
||
class Class(): | ||
def __init__(): | ||
def __init__(self): | ||
return | ||
|
||
def hello_world(): | ||
def hello_world(self): | ||
return 'hello world' |
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,17 @@ | ||
|
||
import sys | ||
from argparse import ArgumentParser | ||
from package.module import Class # rename package, module and class | ||
|
||
def get_args(): | ||
parser = ArgumentParser() | ||
parser.add_argument('--arg', help='') | ||
|
||
return parser.parse_args() | ||
|
||
def run(): | ||
args = get_args() | ||
c = Class() | ||
c.hello_world() | ||
|
||
return |
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,6 @@ | ||
import sys | ||
from package.scripts import script | ||
|
||
def test_script(): | ||
sys.argv = ['--arg=test'] | ||
script.run() |