Skip to content

Commit

Permalink
Fix error with no args
Browse files Browse the repository at this point in the history
Signed-off-by: John Mertic <[email protected]>
  • Loading branch information
jmertic committed Nov 11, 2024
1 parent e0a06f4 commit 9078b86
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions lfx_landscape_tools/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ def __init__(self):
maketextlogo_parser.add_argument("-o", "--output", dest="filename", help="Filename to save created logo to")
maketextlogo_parser.set_defaults(func=self.maketextlogo)

makelogo_parser = subparsers.add_parser("makelogo", help="Create a logo based off an existing log with name as a caption")
makelogo_parser.add_argument("-c", "--crunchbase", dest="crunchbase", required=True, help="Crunchbase entry to match")
makelogo_parser.add_argument("-l", "--baselogo", dest="baselogo", required=True, help="Base logo to add captions to")
makelogo_parser.add_argument("-x", "--excludecategory", dest="category", help="Categories to not look in")

args = parser.parse_args()

logging.basicConfig(
Expand All @@ -71,7 +66,11 @@ def __init__(self):
]
)

args.func(args)
try:
args.func(args)
except AttributeError:
parser.print_help()

logging.getLogger().info("This took {} seconds".format(datetime.now() - self._starttime))

@staticmethod
Expand Down Expand Up @@ -125,16 +124,3 @@ def maketextlogo(self,args):
print(svglogo)

return True

def makelogo(self,args):
# TODO: create parser for all items in landscape, not just one category
landscapeoutput = LandscapeOutput(config=config, resetCategory=True, baseDir=args.basedir)

for item in items:
if os.file.exists(item.logo.filename()) and args.overwrite:
svglogo = SVGLogo(url=baselogo)
svglogo.caption(item.orgname)
item.logo = svglogo

landscapeoutput.updateLandscape()

0 comments on commit 9078b86

Please sign in to comment.