Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

added -d for directory to output it to some other place#4

Open
TomatoCream wants to merge 1 commit intogoweiwen:masterfrom
TomatoCream:master
Open

added -d for directory to output it to some other place#4
TomatoCream wants to merge 1 commit intogoweiwen:masterfrom
TomatoCream:master

Conversation

@TomatoCream
Copy link

added -d for directory to output it to some other place

Copy link
Owner

@goweiwen goweiwen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just some changes. If you like to, we should add a --directory flag as an alias to -d.

"target": "workbin"
}

file.path = base_dir + file.path
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use join(base_dir, file.path) for platform agnostic path joinng.

# session = IVLESession(userid, password)
# if session.token != '':
# sync_announcements(session)
# exit(1)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unused code

exit(-1)

print("Usage: " + argv[0] + " [files|announcements]")
# print("Usage: " + argv[0] + " [files|announcements]")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unused code

print("Usage: " + argv[0] )
print(" -f for files. ")
print(" -a for announcements. ")
print(" -d <directory> to output files to a different directory. ")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use square braces to denote optional fields:

print("Usage: ")
print("  " + argv[0] + " files [-d directory]")
print("  " + argv[0] + " announcements")

if '-d' in args:
base_dir = args['-d'];
if not base_dir.endswith('/'):
base_dir = base_dir + '/'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If using os.path.join, we don't need to add this.

base_dir = args['-d'];
if not base_dir.endswith('/'):
base_dir = base_dir + '/'
print("-d found, placing file in: " + base_dir + "<course code>")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

print("Placing files in: " + base_dir + "/<course code>")

@TomatoCream
Copy link
Author

yes boss i'll cook it right up

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants