Skip to content

Instantly share code, notes, and snippets.

@f0rdprefect
Created January 20, 2021 13:04
Show Gist options
  • Save f0rdprefect/dad579b6fe0e244e7c47ce55b89be08c to your computer and use it in GitHub Desktop.
Save f0rdprefect/dad579b6fe0e244e7c47ce55b89be08c to your computer and use it in GitHub Desktop.
fixed issue
import sys, getopt
import pandas as pd
def filter(file,outfile=""):
if outfile:
of=open(outfile,'w')
issues = pd.read_csv(file)
for id, row in issues.iterrows():
line="* `"+str(row['Issue Id'])+\
" <https://youtrack.raith.de/issue/"+str(row['Issue Id'])+">`_ - "+\
str(row['Summary'])
print(line)
if outfile:
of.write(line+"\n")
if outfile:
of.close()
return(True)
def main(argv):
inputfile = ''
outputfile = ''
try:
opts, args = getopt.getopt(argv,"hi:o:",["ifile=","ofile="])
except getopt.GetoptError:
print('fixedissues.py -i <inputfile> -o <outputfile>')
sys.exit(2)
for opt, arg in opts:
if opt == '-h':
print('fixedissues.py -i <inputfile> -o <outputfile>')
sys.exit()
elif opt in ("-i", "--ifile"):
inputfile = arg
elif opt in ("-o", "--ofile"):
outputfile = arg
print('Input file is "', inputfile)
print('Output file is "', outputfile)
ret=filter(inputfile,outputfile)
if __name__ == "__main__":
main(sys.argv[1:])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment