View Module Documentation¶
-
class
view.
View
(*args, **kwargs)¶ ..class:: View This class is used for getting user inputs. It uses the tkinter GUI package. ..data::master_file
StringVar() variable holds the name of the master file- ..data::local_file
- StringVar() variable holds the name of the local file
- ..data::master_path
- StringVar() variable holds the name of the directory which holds the master file
- ..data::local_path
- StringVar() variable holds the name of the directory which holds the local file
-
call_controller
()¶ Create the controller instance
-
choose_option
()¶ check for the option user selected and help the user select his files
-
close
()¶ deletes the instance of View , commits the new added features to the local file to the remote repository and deletes all the temporary directories that were created for this application
-
list_differences
(list, list2)¶ create a window to display the differences between the two files as two categories: one shows the differences between values of the two properties for a record and the other shows the property present in the master file but not in the local file Args:
list: list of record that have a difference in properties on the master file and the local file list2:list of record that have a property on the master file which is not present on the local file
-
openlocalfile
(event)¶ method is used to select a file from the local hard disk
-
openmasterfile
(event)¶ method is used to select a file from the local hard disk
-
select_disk_files
()¶ create a new window to input the two repositories from which the two bibtex files will be selected
-
select_files
(repo1, repo2, branch1, branch2)¶ given the names of two repositories and their branch names this method creates a local repository and pulls down the content from git
-
select_git_files
()¶ creates a new window and accepts the names of the two git repositories to be used by the application
-
select_rb_files
()¶ creates a window which list the different bibtex files present in the local directories of both the master and local repositories
-
view.
commit_remote
(repo, file)¶ Commits to the index of the local git repository and calls the git push Args:
repo: Reference to the head of the local git repository file: File that will be added to the index for the commit and push
to the remote git repository- Raises:
- git.exc.GitCommandError: If git.push() fails
-
view.
create_local_repo
(remote_git, dir, branch)¶ Uses the git.clone_from method to clone a remote git repository locally Args:
remote_git: Url of the remote git repository dir: Local directory where the contents of the
remote git will be downloadedbranch: Name of the branch on the remote git which will be used for cloning
- Returns:
- git.repo: Reference to the local git repository
- Raises:
- git.exc.InvalidGitRepositoryError: If remote git repository is bare git.exc.GitCommandError: If remote git repository does not exist
-
view.
extract_bib_files
(path)¶ Extracts all the bib files from the given path Args:
path : The directory name from which bib files will be extracted- Returns:
- List[string]: Returns a list of bib files present in path