This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
if content[0].lower() == "!gsoc": | |
self.subscribe_user("gsoc20-outreachy20", sender_email) | |
self.client.send_message({ | |
"type": message_type, | |
"topic": topic, | |
"to": destination, | |
"content": f"{greeting} {self.replies['gsoc']}" | |
}) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
answer = stackoverflow.fetch("answers/{ids}", ids=[str(questions["items"][0]["accepted_answer_id"])], filter="!9Z(-wzftf") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if pull.get_state() == "closed": | |
# do something when pull request is closed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repo = Github(os.environ.get("GitPAT")).get_repo("QEDK/goodbot") | |
pull = repo.create_pull(title="Title here", body="hard at work 🛠️", head="our new branch", base="master", maintainer_can_modify=True) | |
if repo.get_pull(pull.number).state == "closed": | |
# do something when pull request is closed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
with open(os.path.join(os.path.dirname(__file__), "..", "templates", "src")) as file: | |
self.src = json.load(file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import configparser | |
config = configparser.ConfigParser() | |
config.read(os.path.abspath(os.path.expanduser("~/test.ini"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::fs::File; | |
fn main() -> std::io::Result<()> { | |
let mut f = File::open("../somefile.rs")?; | |
Ok(()) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use configparser::ini::Ini; | |
use std::error::Error; | |
fn main() -> Result<(), Box<dyn Error>> { | |
let mut config = Ini::new(); | |
let map = config.load("tests/test.ini")?; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use configparser::ini::Ini; | |
use std::error::Error; | |
#[(test)] | |
fn main() -> Result<(), Box<dyn Error>> { | |
let mut config = Ini::new(); | |
let map = config.load("tests/test.ini")?; | |
} |
NewerOlder