> In `xrandr_cycle`, I don't like much the line in which `my_path` is being > assigned because: > > - is defined in line 20 and not used until line 87
Good point there... moved it.
> - the name isn't very descriptive
renamed in both scripts to script_home
> - I'm not sure why `os.path.split(<whatever>)[0]` is used instead of > `os.path.dirname` > (even if it contains another call to `os.path.dirname`)
bladernr@klaatu:~/development/949435-remove-hard-coded-checkbox-vars/scripts$ ./xrandr_cycle path.realpath : /home/bladernr/development/949435-remove-hard-coded-checkbox-vars/scripts/xrandr_cycle path.dirname : /home/bladernr/development/949435-remove-hard-coded-checkbox-vars/scripts path.split : ('/home/bladernr/development/949435-remove-hard-coded-checkbox-vars', 'scripts')
ultimately,
os.path.split(os.path.dirname(os.path.realpath(__file__)))[0]
does exactly the same thing as
os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
but looks a bit cleaner, IMHO.
« Back to merge proposal
> In `xrandr_cycle`, I don't like much the line in which `my_path` is being
> assigned because:
>
> - is defined in line 20 and not used until line 87
Good point there... moved it.
> - the name isn't very descriptive
renamed in both scripts to script_home
> - I'm not sure why `os.path. split(< whatever> )[0]` is used instead of
> `os.path.dirname`
> (even if it contains another call to `os.path.dirname`)
bladernr@ klaatu: ~/development/ 949435- remove- hard-coded- checkbox- vars/scripts$ ./xrandr_cycle development/ 949435- remove- hard-coded- checkbox- vars/scripts/ xrandr_ cycle development/ 949435- remove- hard-coded- checkbox- vars/scripts bladernr/ development/ 949435- remove- hard-coded- checkbox- vars', 'scripts')
path.realpath : /home/bladernr/
path.dirname : /home/bladernr/
path.split : ('/home/
ultimately,
os.path. split(os. path.dirname( os.path. realpath( __file_ _)))[0]
does exactly the same thing as
os.path. dirname( os.path. dirname( os.path. realpath( __file_ _)))
but looks a bit cleaner, IMHO.