Skip to content

Commit

Permalink
Merge openstack support from Soren Hansen.
Browse files Browse the repository at this point in the history
  • Loading branch information
stgraber committed Feb 12, 2012
2 parents f77069a + 2186f55 commit 8acee85
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
18 changes: 18 additions & 0 deletions pastebin.d/paste.openstack.org.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[pastebin]
basename = paste.openstack.org
regexp = "http://paste.openstack.org"

[format]
lang = language
page = page
content = code
post_format = post_format
regexp = regexp
target_url = target_url

[defaults]
page = "/json/?method=pastes.newPaste"
post_format = "json"
lang = ""
regexp = "\"data\": \"([^"]*)"
target_url = "http://paste.openstack.org/show/"
12 changes: 10 additions & 2 deletions pastebinit
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,11 @@ try:
if "regexp" in params:
reLink = params['regexp']
del params["regexp"]

if "target_url" in params:
target_url = params["target_url"]
del params["target_url"]
else:
target_url = None
if 'post_format' in params:
post_format = params['post_format']
del params['post_format']
Expand All @@ -332,7 +336,11 @@ try:

try:
if reLink: #Check if we have to apply a regexp
website = website.replace(tmp_page, "")
if target_url:
website = target_url
else:
website = website.replace(tmp_page, "")

if reLink == '(.*)':
print page.read().strip()
else:
Expand Down

0 comments on commit 8acee85

Please sign in to comment.