Page MenuHomePhabricator

D11556.diff
No OneTemporary

D11556.diff

diff --git a/src/workflow/ArcanistUploadWorkflow.php b/src/workflow/ArcanistUploadWorkflow.php
--- a/src/workflow/ArcanistUploadWorkflow.php
+++ b/src/workflow/ArcanistUploadWorkflow.php
@@ -30,7 +30,7 @@
public function getArguments() {
return array(
'json' => array(
- 'help' => 'Output upload information in JSON format.',
+ 'help' => pht('Output upload information in JSON format.'),
),
'*' => 'paths',
);
@@ -38,7 +38,8 @@
protected function didParseArguments() {
if (!$this->getArgument('paths')) {
- throw new ArcanistUsageException('Specify one or more files to upload.');
+ throw new ArcanistUsageException(
+ pht('Specify one or more files to upload.'));
}
$this->paths = $this->getArgument('paths');
@@ -49,27 +50,19 @@
return true;
}
- private function getPaths() {
- return $this->paths;
- }
-
- private function getJSON() {
- return $this->json;
- }
-
public function run() {
$conduit = $this->getConduit();
-
$results = array();
foreach ($this->paths as $path) {
$name = basename($path);
- $this->writeStatusMessage("Uploading '{$name}'...\n");
+ $this->writeStatusMessage(pht("Uploading '%s'...", $name)."\n");
+
try {
$data = Filesystem::readFile($path);
} catch (FilesystemException $ex) {
$this->writeStatusMessage(
- "Unable to upload file: ".$ex->getMessage()."\n");
+ pht('Unable to upload file: %s.', $ex->getMessage())."\n");
$results[$path] = null;
continue;
}
@@ -78,26 +71,26 @@
'file.upload',
array(
'data_base64' => base64_encode($data),
- 'name' => $name,
+ 'name' => $name,
));
$info = $conduit->callMethodSynchronous(
'file.info',
array(
- 'phid' => $phid,
+ 'phid' => $phid,
));
$results[$path] = $info;
- if (!$this->getJSON()) {
+ if (!$this->json) {
$id = $info['id'];
echo " F{$id} {$name}: ".$info['uri']."\n\n";
}
}
- if ($this->getJSON()) {
+ if ($this->json) {
echo json_encode($results)."\n";
} else {
- $this->writeStatusMessage("Done.\n");
+ $this->writeStatusMessage(pht('Done.')."\n");
}
return 0;

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 13, 10:54 PM (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7635702
Default Alt Text
D11556.diff (2 KB)

Event Timeline